Examples of SeqPattern


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

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
Copyright © 2018 www.massapi.com. 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.