org.geotools.measure
Class Measure

java.lang.Object
  extended by java.lang.Number
      extended by org.geotools.measure.Measure
All Implemented Interfaces:
java.io.Serializable

public final class Measure
extends java.lang.Number

A scalar with an unit.

Since:
2.1
Version:
$Id: Measure.java 30760 2008-06-18 14:28:24Z desruisseaux $
Author:
Martin Desruisseaux (PMO, IRD)
See Also:
Serialized Form

Constructor Summary
Measure(double value, javax.measure.unit.Unit<?> unit)
          Creates a new measure with the specified value and unit.
 
Method Summary
 byte byteValue()
          Returns the scalar value.
 double doubleValue()
          Returns the scalar value.
 boolean equals(java.lang.Object object)
          Compares this measure with the specified object for equality.
 float floatValue()
          Returns the scalar value.
 javax.measure.unit.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.
 java.lang.String toString()
          Returns a string representation of this measure.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Measure

public Measure(double value,
               javax.measure.unit.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 Detail

doubleValue

public double doubleValue()
Returns the scalar value.

Specified by:
doubleValue in class java.lang.Number

floatValue

public float floatValue()
Returns the scalar value.

Specified by:
floatValue in class java.lang.Number

longValue

public long longValue()
Returns the scalar value.

Specified by:
longValue in class java.lang.Number

intValue

public int intValue()
Returns the scalar value.

Specified by:
intValue in class java.lang.Number

shortValue

public short shortValue()
Returns the scalar value.

Overrides:
shortValue in class java.lang.Number

byteValue

public byte byteValue()
Returns the scalar value.

Overrides:
byteValue in class java.lang.Number

getUnit

public javax.measure.unit.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 class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Compares this measure with the specified object for equality.

Overrides:
equals in class java.lang.Object
Parameters:
object - The object to compare with this measure.
Returns:
true if the given object is equals to this measure.

toString

public java.lang.String toString()
Returns a string representation of this measure.

Overrides:
toString in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.