| org.geotools.util.NumberRange org.geotools.util.MeasurementRange
MeasurementRange | public class MeasurementRange extends NumberRange (Code) | | A range of numbers associated with a unit of measurement. Unit conversions are applied as
needed by
and
operations.
since: 2.4 version: $Id: MeasurementRange.java 26601 2007-08-19 23:16:35Z desruisseaux $ author: Martin Desruisseaux |
Constructor Summary | |
public | MeasurementRange(float minimum, float maximum, Unit units) Constructs an inclusive range of
float values. | public | MeasurementRange(float minimum, boolean isMinIncluded, float maximum, boolean isMaxIncluded, Unit units) Constructs a range of
float values. | public | MeasurementRange(double minimum, double maximum, Unit units) Constructs an inclusive range of
double values. | public | MeasurementRange(double minimum, boolean isMinIncluded, double maximum, boolean isMaxIncluded, Unit units) Constructs a range of
double values. | public | MeasurementRange(Class type, Number minimum, boolean isMinIncluded, Number maximum, boolean isMaxIncluded, Unit units) Constructs a range of
Number objects. | public | MeasurementRange(Range range, Unit units) Constructs a range with the same values than the specified range.
Parameters: range - The range to copy. |
Method Summary | |
NumberRange | convertAndCast(Range range, Class type) Casts the specified range to the specified type. | public MeasurementRange | convertTo(Unit targetUnits) Converts this range to the specified units. | public boolean | equals(Object other) Compares this range with the specified object for equality. | final public Unit | getUnits() Returns the units of measurement, or
null if unknown. | public String | toString() Returns a string representation of this range. |
MeasurementRange | public MeasurementRange(float minimum, float maximum, Unit units)(Code) | | Constructs an inclusive range of
float values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. Parameters: units - The units of measurement, or null if unknown. |
MeasurementRange | public MeasurementRange(float minimum, boolean isMinIncluded, float maximum, boolean isMaxIncluded, Unit units)(Code) | | Constructs a range of
float values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. Parameters: units - The units of measurement, or null if unknown. |
MeasurementRange | public MeasurementRange(double minimum, double maximum, Unit units)(Code) | | Constructs an inclusive range of
double values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. Parameters: units - The units of measurement, or null if unknown. |
MeasurementRange | public MeasurementRange(double minimum, boolean isMinIncluded, double maximum, boolean isMaxIncluded, Unit units)(Code) | | Constructs a range of
double values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. Parameters: units - The units of measurement, or null if unknown. |
MeasurementRange | public MeasurementRange(Class type, Number minimum, boolean isMinIncluded, Number maximum, boolean isMaxIncluded, Unit units)(Code) | | Constructs a range of
Number objects.
Parameters: type - The element class, usually one of Byte, Short,Integer, Long, Float or Double. Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. Parameters: units - The units of measurement, or null if unknown. |
MeasurementRange | public MeasurementRange(Range range, Unit units) throws ClassCastException(Code) | | Constructs a range with the same values than the specified range.
Parameters: range - The range to copy. The elements must be Number instances. Parameters: units - The units of measurement, or null if unknown. throws: ClassCastException - if some elements are not instances of Number. |
convertAndCast | NumberRange convertAndCast(Range range, Class type)(Code) | | Casts the specified range to the specified type. If this class is associated to a unit of
measurement, then this method convert the
range units to the same units than this
instance.
Parameters: type - The class to cast to. Must be one of Byte, Short,Integer, Long, Float or Double. The casted range, or range if no cast is needed. |
convertTo | public MeasurementRange convertTo(Unit targetUnits) throws ConversionException(Code) | | Converts this range to the specified units. If this measurement range has null units,
then the specified target units are simply assigned to the returned range with no
other changes.
Parameters: targetUnit - the target units. The converted range, or this if no conversion is needed. throws: ConversionException - if the target units are not compatible withthis . |
equals | public boolean equals(Object other)(Code) | | Compares this range with the specified object for equality.
|
getUnits | final public Unit getUnits()(Code) | | Returns the units of measurement, or
null if unknown.
|
toString | public String toString()(Code) | | Returns a string representation of this range.
|
|
|