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 TypeMethodDescriptionbyteReturns the scalar value.doubleReturns the scalar value.booleanCompares this measure with the specified object for equality.floatReturns the scalar value.Unit<?>getUnit()Returns the unit.inthashCode()Returns a hash code value for this measure.intintValue()Returns the scalar value.longReturns the scalar value.shortReturns 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:
doubleValuein classNumber
-
floatValue
public float floatValue()Returns the scalar value.- Specified by:
floatValuein 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:
shortValuein 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.
-