|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot.Range
public class Range
Describes a one-dimensional range. This is effectively a lower and upper bound, but either of these may be absent.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
clear()
Unsets the lower and upper bounds for this range. |
double[] |
getBounds()
Returns the current bounds of this range. |
double[] |
getFiniteBounds(boolean positive)
Returns finite upper and lower bounds for this range. |
boolean |
isClear()
Returns true if no data about this range has been set. |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 copyMethod Detail |
---|
public 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 required
public boolean isClear()
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 String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |