Package org.geotools.measure
Class Measure
- Object
-
- Number
-
- 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
-
longValue
public long longValue()
Returns the scalar value.- Specified by:
longValue
in classNumber
-
intValue
public int intValue()
Returns the scalar value.- Specified by:
intValue
in classNumber
-
shortValue
public short shortValue()
Returns the scalar value.- Overrides:
shortValue
in classNumber
-
byteValue
public byte byteValue()
Returns the scalar value.- Overrides:
byteValue
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.- Overrides:
hashCode
in classObject
-
equals
public boolean equals(Object object)
Compares this measure with the specified object for equality.- Overrides:
equals
in classObject
- Parameters:
object
- The object to compare with this measure.- Returns:
true
if the given object is equals to this measure.
-
toString
public String toString()
Returns a string representation of this measure.- Overrides:
toString
in classObject
-
-