Class SequenceList


  • public class SequenceList
    extends java.lang.Object
    This class expands a string into a list of numbers. The main use is to select a range of pages.

    The general syntax is:
    [!][o][odd][e][even]start-end

    You can have multiple ranges separated by commas ','. The '!' modifier removes the range from what is already selected. The range changes are incremental, that is, numbers are added or deleted as the range appears. The start or the end, but not both, can be omitted.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static int COMMA  
      private static int DIGIT  
      private static int DIGIT2  
      protected static int END  
      protected static char EOT  
      protected boolean even  
      private static int FIRST  
      protected int high  
      protected boolean inverse  
      protected int low  
      protected static int MINUS  
      protected static int NOT  
      private static java.lang.String NOT_OTHER  
      protected int number  
      protected static int NUMBER  
      protected boolean odd  
      protected java.lang.String other  
      private static int OTHER  
      protected int ptr  
      protected char[] text  
      protected static int TEXT  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SequenceList​(java.lang.String range)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.Integer> expand​(java.lang.String ranges, int maxNumber)
      Generates a list of numbers from a string.
      protected boolean getAttributes()  
      protected int getType()  
      protected char nextChar()  
      private void otherProc()  
      protected void putBack()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SequenceList

        protected SequenceList​(java.lang.String range)
    • Method Detail

      • nextChar

        protected char nextChar()
      • putBack

        protected void putBack()
      • getType

        protected int getType()
      • otherProc

        private void otherProc()
      • getAttributes

        protected boolean getAttributes()
      • expand

        public static java.util.List<java.lang.Integer> expand​(java.lang.String ranges,
                                                               int maxNumber)
        Generates a list of numbers from a string.
        Parameters:
        ranges - the comma separated ranges
        maxNumber - the maximum number in the range
        Returns:
        a list with the numbers as Integer