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

org.deegree.crs
Class CRSIdentifiable

java.lang.Object
  extended by org.deegree.crs.CRSIdentifiable
Direct Known Subclasses:
Axis, CoordinateSystem, Datum, Ellipsoid, PrimeMeridian, Projection, Transformation, Unit

public class CRSIdentifiable
extends Object

The CRSIdentifiable class can be used to identify any crs, Ellipsoid, Geodetic Datum and Prime Meridian

Version:
$Revision: 22642 $, $Date: 2010-02-19 11:36:40 +0100 (Fr, 19 Feb 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Constructor Summary
CRSIdentifiable(CRSCodeType id)
           
CRSIdentifiable(CRSCodeType[] identifiers)
          Creates arrays fromt the given identifier and name without setting the versions, descriptions and areasOfUse.
CRSIdentifiable(CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
CRSIdentifiable(CRSIdentifiable other)
          Takes the references of the other object and stores them in this CRSIdentifiable Object.
 
Method Summary
 void addAreaOfUse(String areaOfUse)
           
 void addName(String name)
           
static void checkForNullObject(Object[] toBeChecked, String message)
          throws an IllegalArgumentException if the given object array is null or empty
protected  void checkForNullObject(Object toBeChecked, String message)
          throws an InvalidParameterException if the given object is null
static void checkForNullObject(Object toBeChecked, String functionName, String paramName)
          throws an InvalidParameterException if the given object is null
 boolean equals(Object other)
           
 String getAreaOfUse()
           
 double[] getAreaOfUseBBox()
          Returns the area of use, i.e. the domain where this CRSIdentifiable is valid.
 String[] getAreasOfUse()
           
 CRSCodeType getCode()
           
 String getCodeAndName()
           
 CRSCodeType[] getCodes()
           
 String getDescription()
           
 String[] getDescriptions()
           
 String getName()
           
 String[] getNames()
           
 String[] getOrignalCodeStrings()
           
 String getVersion()
           
 String[] getVersions()
           
 boolean hasCode(CRSCodeType id)
           
 boolean hasId(String id, boolean caseSensitive, boolean exact)
           
 boolean hasIdOrName(String idOrName, boolean caseSensitive, boolean exact)
          Iterates over all Ids (code type originals) and Names and tests if either one matches the given string.
 void setDefaultAreaOfUse(double[] bbox)
           
 void setDefaultDescription(String newDescription, boolean override)
           
 void setDefaultId(CRSCodeType newCodeType, boolean override)
           
 void setDefaultName(String defaultName, boolean override)
           
 void setDefaultVersion(String newVersion, boolean override)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CRSIdentifiable

public CRSIdentifiable(CRSIdentifiable other)
Takes the references of the other object and stores them in this CRSIdentifiable Object.

Parameters:
other - identifiable object.

CRSIdentifiable

public CRSIdentifiable(CRSCodeType[] codes,
                       String[] names,
                       String[] versions,
                       String[] descriptions,
                       String[] areasOfUse)
Parameters:
codes -
names - the human readable names of the object.
versions -
descriptions -
areasOfUse -
Throws:
IllegalArgumentException - if no identifier(s) was/were given.

CRSIdentifiable

public CRSIdentifiable(CRSCodeType[] identifiers)
Creates arrays fromt the given identifier and name without setting the versions, descriptions and areasOfUse.

Parameters:
identifiers - of the object.

CRSIdentifiable

public CRSIdentifiable(CRSCodeType id)
Parameters:
id - of the Identifier
Method Detail

getAreaOfUse

public final String getAreaOfUse()
Returns:
the first of all areasOfUse or null if no areasOfUse were given.

getDescription

public final String getDescription()
Returns:
the first of all descriptions or null if no descriptions were given.

getCode

public final CRSCodeType getCode()
Returns:
the first of all identifiers.

getName

public final String getName()
Returns:
the first of all names or null if no names were given.

getVersion

public final String getVersion()
Returns:
the first of all versions or null if no versions were given.

checkForNullObject

protected void checkForNullObject(Object toBeChecked,
                                  String message)
                           throws IllegalArgumentException
throws an InvalidParameterException if the given object is null

Parameters:
toBeChecked - for null
message - to put into the exception. If absent, the default message (CRS_INVALID_NULL_PARAMETER) will be inserted.
Throws:
IllegalArgumentException - if the given object is null.

checkForNullObject

public static void checkForNullObject(Object toBeChecked,
                                      String functionName,
                                      String paramName)
                               throws IllegalArgumentException
throws an InvalidParameterException if the given object is null

Parameters:
toBeChecked - for null
functionName - of the caller
paramName - of the parameter to be checked.
Throws:
IllegalArgumentException - if the given object is null.

checkForNullObject

public static void checkForNullObject(Object[] toBeChecked,
                                      String message)
                               throws IllegalArgumentException
throws an IllegalArgumentException if the given object array is null or empty

Parameters:
toBeChecked - for null or empty
message - to put into the exception. If absent, the default message (CRS_INVALID_NULL_PARAMETER) will be inserted.
Throws:
IllegalArgumentException - if the given object array is null or empty.

toString

public String toString()
Overrides:
toString in class Object

getCodeAndName

public String getCodeAndName()
Returns:
the first id and the name (if given) as id: id, name: name.

equals

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

getAreasOfUse

public final String[] getAreasOfUse()
Returns:
the areasOfUse or null if no areasOfUse were given.

getDescriptions

public final String[] getDescriptions()
Returns:
the descriptions or null if no descriptions were given.

getCodes

public final CRSCodeType[] getCodes()
Returns:
the identifiers, each identifiable object has atleast one id.

getOrignalCodeStrings

public final String[] getOrignalCodeStrings()
Returns:
the codetypes as the original strings, each identifiable object has atleast one id.

getNames

public final String[] getNames()
Returns:
the names or null if no names were given.

getVersions

public final String[] getVersions()
Returns:
the versions or null if no versions were given.

hasCode

public boolean hasCode(CRSCodeType id)
Parameters:
id - a string which could match this identifiable.
Returns:
true if this identifiable can be identified with the given string, false otherwise.

hasIdOrName

public boolean hasIdOrName(String idOrName,
                           boolean caseSensitive,
                           boolean exact)
Iterates over all Ids (code type originals) and Names and tests if either one matches the given string.

Parameters:
idOrName - a String which might be an id or a name.
caseSensitive - should the match me case sensitive
exact - should the names and ids contain the given string or match exact.
Returns:
true if any of the names or codes match without case the given string.

hasId

public boolean hasId(String id,
                     boolean caseSensitive,
                     boolean exact)
Parameters:
id -
caseSensitive -
exact -
Returns:
true if the given id is present in this objects id's.

getAreaOfUseBBox

public double[] getAreaOfUseBBox()
Returns the area of use, i.e. the domain where this CRSIdentifiable is valid.

Returns:
the domain of validity (EPSG:4326 coordinates), order: minX, minY, maxX, maxY, never null (-180,-90,180,90) if no such information is available

setDefaultId

public void setDefaultId(CRSCodeType newCodeType,
                         boolean override)
Parameters:
newCodeType -
override -

setDefaultAreaOfUse

public void setDefaultAreaOfUse(double[] bbox)
Parameters:
bbox - an envelope of validity in epsg:4326 coordinates, min(lon,lat) max(lon,lat);

addAreaOfUse

public void addAreaOfUse(String areaOfUse)
Parameters:
areaOfUse -

addName

public void addName(String name)
Parameters:
name -

setDefaultName

public void setDefaultName(String defaultName,
                           boolean override)
Parameters:
defaultName - the new default name
override - true if the new name should override the name currently at position 0

setDefaultDescription

public void setDefaultDescription(String newDescription,
                                  boolean override)
Parameters:
newDescription - the new default description
override - true if the new description should override the description currently at position 0

setDefaultVersion

public void setDefaultVersion(String newVersion,
                              boolean override)
Parameters:
newVersion - the new default version
override - true if the new version should override the version currently at position 0

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

]]>