org.deegree.commons.uom
Class Measure

java.lang.Object
  extended by org.deegree.commons.uom.Measure
All Implemented Interfaces:
TypedObjectNode
Direct Known Subclasses:
Angle, Length

public class Measure
extends Object
implements TypedObjectNode

Number with a scale.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

Constructor Summary
Measure(BigDecimal value, String uomURI)
          angular degree --> urn:ogc:def:uom:EPSG:6.3:9102 radian --> urn:ogc:def:uom:EPSG::9101 meter --> urn:ogc:def:uom:EPSG:6.3:9001 unity --> urn:ogc:def:uom:EPSG:6.3:8805 from URN definitions
Measure(String value, String uomURI)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getUomUri()
           
 BigDecimal getValue()
           
 double getValueAsDouble()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Measure

public Measure(BigDecimal value,
               String uomURI)
angular degree --> urn:ogc:def:uom:EPSG:6.3:9102 radian --> urn:ogc:def:uom:EPSG::9101 meter --> urn:ogc:def:uom:EPSG:6.3:9001 unity --> urn:ogc:def:uom:EPSG:6.3:8805 from URN definitions

Parameters:
value -
uomURI -

Measure

public Measure(String value,
               String uomURI)
        throws NumberFormatException
Parameters:
value -
uomURI -
Throws:
NumberFormatException
Method Detail

getValue

public BigDecimal getValue()
Returns:
the value

getValueAsDouble

public double getValueAsDouble()
Returns:
the value

getUomUri

public String getUomUri()
Returns:
the uom uri

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.