Class Range

Object
Range
Direct Known Subclasses:
RangeByte, RangeDouble, RangeFloat, RangeInt, RangeLong, RangeShort, RangeUshort

public abstract class Range extends Object
Abstract class used for checking if a selected value is inside the selected Range. All the methods throw an UnsupportedOperationException but for every subclass one of these methods is overridden with the correct functionality. These 6 methods are different only for the data type used. In this way it is possible to reach a better performance by using primitive variables than generic. All the subclasses can contain a Range composed by a minimum and a maximum or a single-point Range. For Double and Float data type the NaN data can be used only with a single-point Range.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum representation of DataBuffer types used.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compare(Range other)
     
    boolean
    contains(byte value)
    Method for checking if a byte value is contained inside the Range
    boolean
    contains(double value)
    Method for checking if a double value is contained inside the Range
    boolean
    contains(float value)
    Method for checking if a float value is contained inside the Range
    boolean
    contains(int value)
    Method for checking if an integer value is contained inside the Range
    boolean
    contains(long value)
    Method for checking if a long value is contained inside the Range
    boolean
    contains(short value)
    Method for checking if a short/ushort value is contained inside the Range
    boolean
    contains(Range other)
     
    <T extends Number>
    boolean
    containsN(T value)
    Method for checking if a Generic value is contained inside the Range
    boolean
     
    Returns the Range data Type
    abstract Number
    Returns the maximum bound of the Range
    abstract Number
    getMax(boolean isMaxIncluded)
    Returns the maximum bound of the Range or the nearest one if not included
    abstract Number
    Returns the minimum bound of the Range
    abstract Number
    getMin(boolean isMinIncluded)
    Returns the minimum bound of the Range or the nearest one if not included
    static int
    hash(boolean value, int seed)
     
    static int
    hash(double value, int seed)
     
    static int
    hash(long value, int seed)
     
    int
     
    abstract Range
     
    boolean
     
    boolean
    Returns the a boolean indicating if the Maximum bound is included
    boolean
    Returns the a boolean indicating if the Minimum bound is included
    boolean
    Returns true if and only if the current Range is a point representing NaN
    boolean
    Returns true if the current Range accepts NaN values
    abstract boolean
    Indicates if the Range is a degenerated single point Range or not
     
    abstract Range
    union(Range other)
     

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • contains

      public boolean contains(byte value)
      Method for checking if a byte value is contained inside the Range
    • contains

      public boolean contains(short value)
      Method for checking if a short/ushort value is contained inside the Range
    • contains

      public boolean contains(int value)
      Method for checking if an integer value is contained inside the Range
    • contains

      public boolean contains(float value)
      Method for checking if a float value is contained inside the Range
    • contains

      public boolean contains(double value)
      Method for checking if a double value is contained inside the Range
    • contains

      public boolean contains(long value)
      Method for checking if a long value is contained inside the Range
    • containsN

      public <T extends Number> boolean containsN(T value)
      Method for checking if a Generic value is contained inside the Range
    • contains

      public boolean contains(Range other)
    • intersects

      public boolean intersects(Range other)
    • intersection

      public abstract Range intersection(Range other)
    • union

      public abstract Range union(Range other)
    • getDataType

      public abstract Range.DataType getDataType()
      Returns the Range data Type
    • isPoint

      public abstract boolean isPoint()
      Indicates if the Range is a degenerated single point Range or not
    • getMax

      public abstract Number getMax()
      Returns the maximum bound of the Range
    • getMin

      public abstract Number getMin()
      Returns the minimum bound of the Range
    • getMax

      public abstract Number getMax(boolean isMaxIncluded)
      Returns the maximum bound of the Range or the nearest one if not included
    • getMin

      public abstract Number getMin(boolean isMinIncluded)
      Returns the minimum bound of the Range or the nearest one if not included
    • isNanIncluded

      public boolean isNanIncluded()
      Returns true if the current Range accepts NaN values
    • isNaN

      public boolean isNaN()
      Returns true if and only if the current Range is a point representing NaN
    • isMaxIncluded

      public boolean isMaxIncluded()
      Returns the a boolean indicating if the Maximum bound is included
    • isMinIncluded

      public boolean isMinIncluded()
      Returns the a boolean indicating if the Minimum bound is included
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compare

      public int compare(Range other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hash

      public static int hash(boolean value, int seed)
    • hash

      public static int hash(double value, int seed)
    • hash

      public static int hash(long value, int seed)
    • toString

      public String toString()
      Overrides:
      toString in class Object