Class ParseIntRanges


  • public class ParseIntRanges
    extends java.lang.Object
    Parse integer range syntaxes.
    Since:
    0.7.5
    Author:
    Erich Schubert
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ParseIntRanges()
      Utility class, do not instantiate.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static int nextSep​(java.lang.String str, int start)
      Find the next separator.
      static IntGenerator parseIntRanges​(java.lang.String str)
      Parse integer ranges, in different syntaxes.
      • Methods inherited from class java.lang.Object

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

      • ParseIntRanges

        private ParseIntRanges()
        Utility class, do not instantiate.
    • Method Detail

      • parseIntRanges

        public static IntGenerator parseIntRanges​(java.lang.String str)
        Parse integer ranges, in different syntaxes. 1 1,2,3,...,10 1,3,,10 1,3,..,10 1,3,...,10 1,+,5 1,++,5 1,+=2,10 1,*=2,16 1,2,3,4,..,10,100 100,1,3,..,10 1,2,..,10,20,..,100,200,..,1000
        Parameters:
        str - Ranges to parse
        Returns:
        Ranges
      • nextSep

        private static int nextSep​(java.lang.String str,
                                   int start)
        Find the next separator.

        TODO: allow other separators, too?

        Parameters:
        str - String
        start - Starting position
        Returns:
        Next separator position, or end of string.