Class SequenceList


  • public class SequenceList
    extends 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.

    • Constructor Detail

      • SequenceList

        protected SequenceList​(String range)
    • Method Detail

      • nextChar

        protected char nextChar()
      • putBack

        protected void putBack()
      • getType

        protected int getType()
      • getAttributes

        protected boolean getAttributes()
      • expand

        public static List<Integer> expand​(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