Package org.geotools.measure
Class Measure
- All Implemented Interfaces:
Serializable
A scalar with an unit.
- Since:
- 2.1
- Author:
- Martin Desruisseaux (PMO, IRD)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMeasure
(double value, Unit<?> unit) Creates a new measure with the specified value and unit. -
Method Summary
Modifier and TypeMethodDescriptionbyte
Returns the scalar value.double
Returns the scalar value.boolean
Compares this measure with the specified object for equality.float
Returns the scalar value.Unit<?>
getUnit()
Returns the unit.int
hashCode()
Returns a hash code value for this measure.int
intValue()
Returns the scalar value.long
Returns the scalar value.short
Returns the scalar value.toString()
Returns a string representation of this measure.
-
Constructor Details
-
Measure
public Measure(double value, Unit<?> unit) Creates a new measure with the specified value and unit.- Parameters:
value
- The value.unit
- The unit of measurement for the given value.
-
-
Method Details
-
doubleValue
public double doubleValue()Returns the scalar value.- Specified by:
doubleValue
in classNumber
-
floatValue
public float floatValue()Returns the scalar value.- Specified by:
floatValue
in classNumber
-
longValue
public long longValue()Returns the scalar value. -
intValue
public int intValue()Returns the scalar value. -
shortValue
public short shortValue()Returns the scalar value.- Overrides:
shortValue
in classNumber
-
byteValue
public byte byteValue()Returns the scalar value. -
getUnit
public Unit<?> getUnit()Returns the unit.- Returns:
- The unit of measurement.
-
hashCode
public int hashCode()Returns a hash code value for this measure. -
equals
Compares this measure with the specified object for equality. -
toString
Returns a string representation of this measure.
-