Package org.geotools.measure
Class Measure
-
- All Implemented Interfaces:
Serializable
public final class Measure extends Number
A scalar with an unit.- Since:
- 2.1
- Author:
- Martin Desruisseaux (PMO, IRD)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Measure(double value, Unit<?> unit)
Creates a new measure with the specified value and unit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
byteValue()
Returns the scalar value.double
doubleValue()
Returns the scalar value.boolean
equals(Object object)
Compares this measure with the specified object for equality.float
floatValue()
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
longValue()
Returns the scalar value.short
shortValue()
Returns the scalar value.String
toString()
Returns a string representation of this measure.
-
-
-
Method Detail
-
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
-
shortValue
public short shortValue()
Returns the scalar value.- Overrides:
shortValue
in classNumber
-
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
public boolean equals(Object object)
Compares this measure with the specified object for equality.
-
-