public final class Range extends Object
For the purpose of range calculation, NaNs should be skipped. The only case where NaNs are allowed is for the UNDEFINED range.
The minimum and maximum are simply double values.
Modifier and Type | Method and Description |
---|---|
Range |
combine(Range other)
Determines the range that can contain both ranges.
|
boolean |
contains(double value)
Determines whether the value is contained by the range or not.
|
boolean |
contains(Range range)
Determines whether the given range is contained by the range or not.
|
static Range |
create(double minValue,
double maxValue)
Range from given min and max.
|
boolean |
equals(Object obj) |
double |
getMaximum()
The maximum value.
|
double |
getMinimum()
The minimum value.
|
int |
hashCode() |
boolean |
isFinite()
Whether the range is finite and non-zero.
|
boolean |
isReversed()
Whether the range goes from min to max or from max to min.
|
double |
normalize(double value)
Returns the value normalized within the range.
|
String |
toString() |
static Range |
undefined()
An undefined range.
|
public double getMinimum()
public double getMaximum()
public boolean isReversed()
public boolean isFinite()
public double normalize(double value)
value
- a valuepublic boolean contains(double value)
value
- a valuepublic boolean contains(Range range)
range
- a rangepublic Range combine(Range other)
other
- another rangepublic static Range undefined()
public static Range create(double minValue, double maxValue)
minValue
- minimum valuemaxValue
- maximum valueCopyright © 2015. All rights reserved.