public class Range extends Object
Constructor and Description |
---|
Range()
Constructs an unbounded range.
|
Range(double[] bounds)
Constructs a range with given lower and upper bounds.
|
Range(double lo,
double hi)
Constructs a range with given lower and upper bounds.
|
Range(Range range)
Constructs a new range which is a copy of an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Unsets the lower and upper bounds for this range.
|
boolean |
equals(Object o) |
void |
extend(Range other)
Extends this range by another one.
|
double[] |
getBounds()
Returns the current bounds of this range.
|
double[] |
getFiniteBounds(boolean positive)
Returns finite upper and lower bounds for this range.
|
int |
hashCode() |
boolean |
isClear()
Returns true if no data about this range has been set.
|
boolean |
isFinite()
Returns true if both ends of the range have values which are not NaN.
|
void |
limit(double[] bounds)
Limits the bounds of this range.
|
void |
limit(double lo,
double hi)
Limits the bounds of this range.
|
void |
limit(Range boundRange)
Limits this range by another one.
|
void |
pad(double ratio)
Adds padding to either end of this range.
|
void |
setBounds(double[] bounds)
Resets the bounds of this range.
|
void |
setBounds(double lo,
double hi)
Resets the bounds of this range.
|
void |
submit(double datum)
Submits a value to this range.
|
String |
toString() |
public Range()
public Range(double lo, double hi)
lo
- lower boundhi
- upper boundpublic Range(double[] bounds)
bounds
array are taken
as the initial lower and upper bounds. Either may be NaN.bounds
- 2-element array giving lower, upper boundspublic Range(Range range)
range
- range to copypublic void submit(double datum)
value
datum
- value to accommodate in this rangepublic void setBounds(double[] bounds)
bounds
array are taken
as the initial lower and upper bounds. Either may be NaN.bounds
- 2-element array giving lower, upper boundspublic void setBounds(double lo, double hi)
lo
- lower boundhi
- upper boundpublic double[] getBounds()
public double[] getFiniteBounds(boolean positive)
positive
parameter is set true, then both returned bounds are guaranteed
to be greater than zero.positive
- true iff strictly positive bounds are requiredpublic boolean isClear()
public boolean isFinite()
public void pad(double ratio)
ratio
- padding ratio (should normally be greater than 0)public void clear()
public void limit(double lo, double hi)
lo
- new lower bound, or NaNhi
- new upper bound, or NaNpublic void limit(double[] bounds)
bounds
- 2-element array giving new lower, upper bounds;
either may be NaNpublic void limit(Range boundRange)
boundRange
is finite, it
will replace the corresponding bound of this one.boundRange
- range giving new boundspublic void extend(Range other)
other
- other rangeCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.