Class ValueRange

  • All Implemented Interfaces:
    java.lang.Comparable<ValueRange>

    public class ValueRange
    extends java.lang.Object
    implements java.lang.Comparable<ValueRange>
    Associates an integer value with a numeric range.
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueRange​(long start, long end, int value)
      Constructor for numeric range with an associated value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(ValueRange otherRange)  
      boolean contains​(long index)
      Determines whether or not the indicated index is in the range.
      long getEnd()
      Returns the end of the range.
      long getStart()
      Returns the beginning of the range.
      int getValue()
      Returns the value associated with the range.
      • Methods inherited from class java.lang.Object

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

      • ValueRange

        public ValueRange​(long start,
                          long end,
                          int value)
        Constructor for numeric range with an associated value.
        Parameters:
        start - beginning of the range
        end - end of the range
        value - the value to associate with the range.
    • Method Detail

      • getStart

        public long getStart()
        Returns the beginning of the range.
      • getEnd

        public long getEnd()
        Returns the end of the range.
      • getValue

        public int getValue()
        Returns the value associated with the range.
      • contains

        public boolean contains​(long index)
        Determines whether or not the indicated index is in the range.
        Parameters:
        index - the index to check
        Returns:
        true if the index is in this range.
      • compareTo

        public int compareTo​(ValueRange otherRange)
        Specified by:
        compareTo in interface java.lang.Comparable<ValueRange>