Class Range


  • public class Range
    extends java.lang.Object
    Provides a range data object.
    Author:
    Joel HÃ¥kansson
    • Constructor Summary

      Constructors 
      Constructor Description
      Range​(int from)
      Create a new range.
      Range​(int from, int to)
      Create a new range.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean inRange​(int value)
      Test if a value is in range
      static Range parseRange​(java.lang.String range)
      Parses the string as a range
      • Methods inherited from class java.lang.Object

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

      • Range

        public Range​(int from,
                     int to)
        Create a new range.
        Parameters:
        from - first page, inclusive
        to - last page, inclusive
      • Range

        public Range​(int from)
        Create a new range.
        Parameters:
        from - first page, inclusive
    • Method Detail

      • parseRange

        public static Range parseRange​(java.lang.String range)
        Parses the string as a range
        Parameters:
        range -
        Returns:
        returns a Range object
        Throws:
        java.lang.NumberFormatException - if the range cannot be parsed
      • inRange

        public boolean inRange​(int value)
        Test if a value is in range
        Parameters:
        value -
        Returns:
        returns true if value is in range, false otherwise