public class CombinedNumericRange extends AbstractNumericRange<Double>
PROPERTY_MAX, PROPERTY_MIN
Constructor and Description |
---|
CombinedNumericRange()
Using this constructor relies on the user subsequently calling add() to add a range
|
Modifier and Type | Method and Description |
---|---|
CombinedNumericRange |
add(Range<Double> range)
Add a new range to this combined range.
|
void |
adjust(Double lower,
Double upper)
Calls to this method throw an UnsupportedOprationException.
|
boolean |
contains(Double x)
This range contains some point iff one or more of its sub-ranges contain that point
|
Range<Double> |
createIntermediate(Range<Double> targetRange,
double position) |
NumericRange |
getRange(double leadingMarginProportion,
double trailingMarginProportion)
Returns a new numeric range that is based on this range, but with a margin introduced at each end.
|
Double |
lower()
The lower value in the range; here, the same as
minimum |
double |
maximum()
Lazily calculates the maximum value in the range
|
double |
minimum()
Lazily calculates the minimum value in the range
|
int |
rangeCount()
Returns the number of sub-ranges contained by this range
|
double |
size()
The size of the range is computed as the maximum minus the minimum value.
|
String |
toString() |
Double |
upper()
The upper value in the range; here, the same as
maximum() |
addPropertyChangeListener, copy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener
public CombinedNumericRange()
public CombinedNumericRange add(Range<Double> range)
range
- the new range to addpublic Double lower()
minimum
public Double upper()
maximum()
public int rangeCount()
public void adjust(Double lower, Double upper)
lower
- the new smallest value of the rangeupper
- the new largest value of the rangeUnsupportedOperationException
public double maximum()
public double minimum()
public boolean contains(Double x)
public double size()
public NumericRange getRange(double leadingMarginProportion, double trailingMarginProportion)
leadingMarginProportion
- how much margin to add at the low end of the rangetrailingMarginProportion
- how much margin to add at the top end of the rangepublic Range<Double> createIntermediate(Range<Double> targetRange, double position)
createIntermediate
in class AbstractRange<Double>