Class Subrange


  • @Equality
    public class Subrange
    extends java.lang.Object
    Designates a sub-range. A subrange is a pair of values (lo,hi) for which lo<=hi, which modifies an external range. If (lo,hi) is (0,1), the external range is unmodified. The natural span of a subrange is therefore in the range 0-1, but there is nothing to stop its values going lower than zero or greater than 1.
    Since:
    12 Feb 2013
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      Subrange()
      Constructs a subrange covering the whole range 0-1.
      Subrange​(double lo, double hi)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      double getHigh()
      Returns upper limit.
      double getLow()
      Returns lower limit.
      int hashCode()  
      static boolean isIdentity​(Subrange subrange)
      Indicates whether a given subrange is the identity operation, that is has no effect on a range to which it is applied.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Subrange

        public Subrange​(double lo,
                        double hi)
        Constructor.
        Parameters:
        lo - lower limit
        hi - upper limit
        Throws:
        java.lang.IllegalArgumentException - unless lo<=hi
      • Subrange

        public Subrange()
        Constructs a subrange covering the whole range 0-1.
    • Method Detail

      • getLow

        public double getLow()
        Returns lower limit.
        Returns:
        low bound
      • getHigh

        public double getHigh()
        Returns upper limit.
        Returns:
        high bound
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isIdentity

        public static boolean isIdentity​(Subrange subrange)
        Indicates whether a given subrange is the identity operation, that is has no effect on a range to which it is applied.
        Parameters:
        subrange - subrange to test
        Returns:
        true iff subrange has values (0,1)