Class IntRange

  • All Implemented Interfaces:
    INumberRange
    Direct Known Subclasses:
    CtrIntRange

    public class IntRange
    extends Range<Long>
    implements INumberRange
    The IntRange class stores range of integers. Examples : "1-3", "2 .. 4", "123 ... 1000" (Important: using of ".." and "..." requires spaces between numbers and separator).
    • Field Detail

      • min

        protected long min
      • max

        protected long max
    • Constructor Detail

      • IntRange

        public IntRange​(long min,
                        long max)
        Constructor for IntRange with provided min and max values.
      • IntRange

        public IntRange​(long number)
      • IntRange

        public IntRange()
      • IntRange

        public IntRange​(String range)
        Constructor for IntRange. Tries to parse range text with variety of formats. Supported range formats: " - " or "[<, <=, >, >=]" or "+" Also numbers can be enhanced with $ sign and K,M,B, e.g. $1K = 1000 Any symbols at the end are allowed to support expressions like ">=2 barrels", "6-8 km^2"