Package org.eclipse.imagen.media.range
Class Range
Object
Range
- Direct Known Subclasses:
RangeByte,RangeDouble,RangeFloat,RangeInt,RangeLong,RangeShort,RangeUshort
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 -
Method Summary
Modifier and TypeMethodDescriptionintbooleancontains(byte value) Method for checking if a byte value is contained inside the Rangebooleancontains(double value) Method for checking if a double value is contained inside the Rangebooleancontains(float value) Method for checking if a float value is contained inside the Rangebooleancontains(int value) Method for checking if an integer value is contained inside the Rangebooleancontains(long value) Method for checking if a long value is contained inside the Rangebooleancontains(short value) Method for checking if a short/ushort value is contained inside the Rangeboolean<T extends Number>
booleancontainsN(T value) Method for checking if a Generic value is contained inside the Rangebooleanabstract Range.DataTypeReturns the Range data Typeabstract NumbergetMax()Returns the maximum bound of the Rangeabstract NumbergetMax(boolean isMaxIncluded) Returns the maximum bound of the Range or the nearest one if not includedabstract NumbergetMin()Returns the minimum bound of the Rangeabstract NumbergetMin(boolean isMinIncluded) Returns the minimum bound of the Range or the nearest one if not includedstatic inthash(boolean value, int seed) static inthash(double value, int seed) static inthash(long value, int seed) inthashCode()abstract Rangeintersection(Range other) booleanintersects(Range other) booleanReturns the a boolean indicating if the Maximum bound is includedbooleanReturns the a boolean indicating if the Minimum bound is includedbooleanisNaN()Returns true if and only if the current Range is a point representing NaNbooleanReturns true if the current Range accepts NaN valuesabstract booleanisPoint()Indicates if the Range is a degenerated single point Range or nottoString()abstract Range
-
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
Method for checking if a Generic value is contained inside the Range -
contains
-
intersects
-
intersection
-
union
-
getDataType
Returns the Range data Type -
isPoint
public abstract boolean isPoint()Indicates if the Range is a degenerated single point Range or not -
getMax
Returns the maximum bound of the Range -
getMin
Returns the minimum bound of the Range -
getMax
Returns the maximum bound of the Range or the nearest one if not included -
getMin
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
-
compare
-
hashCode
public int hashCode() -
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
-