public class NumericRange extends AbstractNumericRange<java.lang.Double>
Modifier and Type | Field | Description |
---|---|---|
protected double |
_max |
|
protected double |
_min |
PROPERTY_MAX, PROPERTY_MIN
Constructor | 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 | Description |
---|---|---|
void |
adjust(java.lang.Double lower,
java.lang.Double upper) |
Sets the minimum and maximum values of the range in a single call
|
boolean |
contains(java.lang.Double x) |
Determines whether the range contains the supplied value
|
Range<java.lang.Double> |
copy() |
|
Range<java.lang.Double> |
createIntermediate(Range<java.lang.Double> target,
double position) |
|
boolean |
equals(java.lang.Object other) |
Test for equality based on the values of min and max
|
double |
getMax() |
|
double |
getMin() |
|
int |
hashCode() |
|
java.lang.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.
|
java.lang.String |
toString() |
|
static NumericRange |
union(NumericRange r1,
NumericRange r2) |
Creates a new NumericRange as the union of two existing NumericRanges.
|
java.lang.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<java.lang.Double> copy()
copy
in class AbstractRange<java.lang.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 java.lang.Double lower()
public void adjust(java.lang.Double lower, java.lang.Double upper)
lower
- the new smallest value of the rangeupper
- the new largest value of the rangepublic java.lang.Double upper()
public boolean contains(java.lang.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<java.lang.Double> createIntermediate(Range<java.lang.Double> target, double position)
createIntermediate
in class AbstractRange<java.lang.Double>
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static NumericRange union(NumericRange r1, NumericRange r2)
r1
- the first NumericRanger2
- the second NumericRange