org.deegree.cs.components
Class PrimeMeridian

java.lang.Object
  extended by org.deegree.cs.CRSIdentifiable
      extended by org.deegree.cs.components.PrimeMeridian
All Implemented Interfaces:
Object, TypedObjectNode, IPrimeMeridian, CRSResource

public class PrimeMeridian
extends CRSIdentifiable
implements IPrimeMeridian

The PrimeMeridian class saves the longitude to the greenwich meridian.

Version:
$Revision: 30120 $, $Date: 2011-03-22 10:04:15 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Field Summary
static PrimeMeridian GREENWICH
          The PrimeMeridian of greenwich with epsg:8901 code and radian units.
 
Constructor Summary
PrimeMeridian(IUnit units, CRSCodeType[] codes)
          A Prime meridian with 0 degrees longitude from the greenwich meridian.
PrimeMeridian(IUnit units, CRSCodeType code, String name)
          A Prime meridian with 0 degrees longitude from the greenwich meridian.
PrimeMeridian(IUnit units, double longitude, CRSCodeType code)
           
PrimeMeridian(IUnit units, double longitude, CRSCodeType[] codes)
           
PrimeMeridian(IUnit units, double longitude, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
PrimeMeridian(IUnit units, double longitude, CRSCodeType code, String name, String version, String description, String areaOfUse)
           
PrimeMeridian(IUnit units, double longitude, CRSResource id)
           
 
Method Summary
 boolean equals(Object other)
           
 IUnit getAngularUnit()
           
 double getLongitude()
           
 double getLongitude(IUnit 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(IUnit units)
           
 void setLongitude(double longitude, IUnit units)
           
 String toString()
           
 
Methods inherited from class org.deegree.cs.CRSIdentifiable
addAreaOfUse, addName, checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getId, 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
 
Methods inherited from interface org.deegree.cs.CRSResource
addAreaOfUse, addName, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion
 
Methods inherited from interface org.deegree.commons.tom.Object
getId
 

Field Detail

GREENWICH

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

Constructor Detail

PrimeMeridian

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

PrimeMeridian

public PrimeMeridian(IUnit 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(IUnit 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(IUnit units,
                     double longitude,
                     CRSCodeType[] codes)
Parameters:
units - Angular units of longitude.
longitude -
codes -

PrimeMeridian

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

PrimeMeridian

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

Parameters:
units - Angular units of longitude.
codes -

PrimeMeridian

public PrimeMeridian(IUnit 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()
Specified by:
getLongitude in interface IPrimeMeridian
Returns:
the longitude value relative to the Greenwich Meridian. The longitude is expressed in this objects angular units.

getLongitude

public double getLongitude(IUnit targetUnit)
Specified by:
getLongitude in interface IPrimeMeridian
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()
Specified by:
getLongitudeAsRadian in interface IPrimeMeridian
Returns:
the longitude value relative to the Greenwich Meridian, expressed in the radians.

getAngularUnit

public IUnit getAngularUnit()
Specified by:
getAngularUnit in interface IPrimeMeridian
Returns:
the angular unit.

setAngularUnit

public void setAngularUnit(IUnit units)
Specified by:
setAngularUnit in interface IPrimeMeridian
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 CRSIdentifiable
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

setLongitude

public void setLongitude(double longitude,
                         IUnit units)
Specified by:
setLongitude in interface IPrimeMeridian
Parameters:
longitude -
units -


Copyright © 2011. All Rights Reserved.