Package org.beangle.commons.text.seq

Examples of org.beangle.commons.text.seq.MultiLevelSeqGenerator


import org.testng.annotations.Test;

public class MultiLevelSeqGeneratorTest {
  @Test
  public void testGenerator() {
    MultiLevelSeqGenerator sg = new MultiLevelSeqGenerator();
    sg.add(new SeqPattern(SeqNumStyle.HANZI, "{1}"));
    sg.add(new SeqPattern(SeqNumStyle.HANZI, "({2})"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}.{4}"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}.{4}.{5}"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}.{4}.{5}.{6}"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}.{4}.{5}.{6}.{7}"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}.{4}.{5}.{6}.{7}.{8}"));
    sg.add(new SeqPattern(SeqNumStyle.ARABIC, "{3}.{4}.{5}.{6}.{7}.{8}.{9}"));

    assertEquals("一", sg.getSytle(1).next());
    assertEquals("(一)", sg.getSytle(2).next());
    assertEquals("1", sg.getSytle(3).next());
    assertEquals("1.1", sg.getSytle(4).next());
  }
View Full Code Here

TOP

Related Classes of org.beangle.commons.text.seq.MultiLevelSeqGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.