deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.crs.components
Class PrimeMeridian

java.lang.Object
  extended by org.deegree.crs.CRSIdentifiable
      extended by org.deegree.crs.components.PrimeMeridian

public class PrimeMeridian
extends CRSIdentifiable

The PrimeMeridian class saves the longitude to the greenwich meridian.

Version:
$Revision: 22628 $, $Date: 2010-02-19 10:53:12 +0100 (Fr, 19 Feb 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Field Summary
static PrimeMeridian GREENWICH
          The PrimeMeridian of greenwich with epsg:8901 code and radian units.
 
Constructor Summary
PrimeMeridian(Unit units, CRSCodeType[] codes)
          A Prime meridian with 0 degrees longitude from the greenwich meridian.
PrimeMeridian(Unit units, CRSCodeType code, String name)
          A Prime meridian with 0 degrees longitude from the greenwich meridian.
PrimeMeridian(Unit units, double longitude, CRSCodeType code)
           
PrimeMeridian(Unit units, double longitude, CRSCodeType[] codes)
           
PrimeMeridian(Unit units, double longitude, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
PrimeMeridian(Unit units, double longitude, CRSCodeType code, String name, String version, String description, String areaOfUse)
           
PrimeMeridian(Unit units, double longitude, CRSIdentifiable id)
           
 
Method Summary
 boolean equals(Object other)
           
 Unit getAngularUnit()
           
 double getLongitude()
           
 double getLongitude(Unit targetUnit)
           
 double getLongitudeAsRadian()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 void setAngularUnit(Unit units)
           
 void setLongitude(double longitude, Unit units)
           
 String toString()
           
 
Methods inherited from class org.deegree.crs.CRSIdentifiable
addAreaOfUse, addName, checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GREENWICH

public static final PrimeMeridian GREENWICH
The PrimeMeridian of greenwich with epsg:8901 code and radian units.

Constructor Detail

PrimeMeridian

public PrimeMeridian(Unit units,
                     double longitude,
                     CRSIdentifiable id)
Parameters:
units - Angular units of longitude, normally radians.
longitude - (in given units) normally radians.
id - to be cloned

PrimeMeridian

public PrimeMeridian(Unit units,
                     double longitude,
                     CRSCodeType[] codes,
                     String[] names,
                     String[] versions,
                     String[] descriptions,
                     String[] areasOfUse)
Parameters:
units - Angular units of longitude, normally radians.
longitude - (in given units) normally radians.
codes -
names -
versions -
descriptions -
areasOfUse -

PrimeMeridian

public PrimeMeridian(Unit units,
                     double longitude,
                     CRSCodeType code,
                     String name,
                     String version,
                     String description,
                     String areaOfUse)
Parameters:
units - Angular units of longitude.
longitude -
code -
name -
version -
description -
areaOfUse -

PrimeMeridian

public PrimeMeridian(Unit units,
                     double longitude,
                     CRSCodeType[] codes)
Parameters:
units - Angular units of longitude.
longitude -
codes -

PrimeMeridian

public PrimeMeridian(Unit units,
                     double longitude,
                     CRSCodeType code)
Parameters:
units - Angular units of longitude.
longitude -
code -

PrimeMeridian

public PrimeMeridian(Unit units,
                     CRSCodeType[] codes)
A Prime meridian with 0 degrees longitude from the greenwich meridian.

Parameters:
units - Angular units of longitude.
codes -

PrimeMeridian

public PrimeMeridian(Unit units,
                     CRSCodeType code,
                     String name)
A Prime meridian with 0 degrees longitude from the greenwich meridian.

Parameters:
units - Angular units of longitude.
code -
name - human readable name
Method Detail

getLongitude

public double getLongitude()
Returns:
the longitude value relative to the Greenwich Meridian. The longitude is expressed in this objects angular units.

getLongitude

public double getLongitude(Unit targetUnit)
Parameters:
targetUnit - The unit in which to express longitude.
Returns:
the longitude value relative to the Greenwich Meridian, expressed in the specified units. This convenience method make easier to obtains longitude in degrees (getLongitude(Unit.DEGREE)), no matter the underlying angular unit of this prime meridian.

getLongitudeAsRadian

public double getLongitudeAsRadian()
Returns:
the longitude value relative to the Greenwich Meridian, expressed in the radians.

getAngularUnit

public Unit getAngularUnit()
Returns:
the angular unit.

setAngularUnit

public void setAngularUnit(Unit units)
Parameters:
units - to be used

equals

public boolean equals(Object other)
Overrides:
equals in class CRSIdentifiable

toString

public String toString()
Overrides:
toString in class CRSIdentifiable

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()

setLongitude

public void setLongitude(double longitude,
                         Unit units)
Parameters:
longitude -
units -

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>