public class NumericRange extends AbstractNumericRange<Double>
Modifier and Type | Field and Description |
---|---|
protected double |
_max |
protected double |
_min |
PROPERTY_MAX, PROPERTY_MIN
Constructor and Description |
---|
NumericRange()
Creates a numeric range with minimum 0.0 and maximum of 1.0
|
NumericRange(double min,
double max)
Create a numeric range by supplying minimum and maximum values
|
NumericRange(NumericRange numericRange)
Creates a copy of the supplied NumericRange
|
Modifier and Type | Method and Description |
---|---|
void |
adjust(Double lower,
Double upper)
Sets the minimum and maximum values of the range in a single call
|
boolean |
contains(Double x)
Determines whether the range contains the supplied value
|
Range<Double> |
copy() |
Range<Double> |
createIntermediate(Range<Double> target,
double position) |
boolean |
equals(Object other)
Test for equality based on the values of min and max
|
double |
getMax() |
double |
getMin() |
int |
hashCode() |
Double |
lower() |
double |
maximum()
This may be the numeric representation of upper() or it may be rounded up.
|
double |
minimum()
This may be the numeric representation of lower() or it may be rounded down.
|
void |
setMax(double max)
Sets the maximum value
|
void |
setMin(double min)
Sets the minimum value
|
double |
size()
Compute the size of the range
|
NumericRange |
stretch(double stretchFactor)
Creates a new NumericRange by enlarging this numeric range about its mid-point.
|
NumericRange |
stretch(double stretchFactorForLower,
double stretchFactorForUpper)
Creates a new NumericRange by enlarging this numeric range about its mid-point.
|
String |
toString() |
static NumericRange |
union(NumericRange r1,
NumericRange r2)
Creates a new TimeRange as the union of two existing TimeRanges.
|
Double |
upper() |
addPropertyChangeListener, compareTo, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener
public NumericRange()
public NumericRange(double min, double max)
min
- the minumummax
- the maximumpublic NumericRange(NumericRange numericRange)
numericRange
- the NumericRange instance to copypublic Range<Double> copy()
copy
in class AbstractRange<Double>
public double minimum()
Range
public double maximum()
Range
public double getMin()
public void setMin(double min)
min
- the new minimum value.public double getMax()
public void setMax(double max)
max
- the new maximum value.public double size()
Range
public Double lower()
public void adjust(Double lower, Double upper)
lower
- the new smallest value of the rangeupper
- the new largest value of the rangepublic Double upper()
public boolean contains(Double x)
public NumericRange stretch(double stretchFactor)
stretchFactor
- the multiplication factor for the enlargementpublic NumericRange stretch(double stretchFactorForLower, double stretchFactorForUpper)
stretchFactorForLower
- the multiplication factor for the enlargement for the lower rangestretchFactorForUpper
- the multiplication factor for the enlargement for the upper rangepublic Range<Double> createIntermediate(Range<Double> target, double position)
createIntermediate
in class AbstractRange<Double>
public boolean equals(Object other)
public static NumericRange union(NumericRange r1, NumericRange r2)
r1
- the first TimeRanger2
- the second TimeRange