org.deegree_impl.model.cs
Class Info

java.lang.Object
  extended byorg.deegree_impl.model.cs.Info
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CoordinateSystem, CoordinateTransformation, Datum, Ellipsoid, PrimeMeridian, Projection

public class Info
extends java.lang.Object
implements java.io.Serializable

A base class for metadata applicable to coordinate system objects. The metadata items "Abbreviation", "Alias", "Authority", "AuthorityCode", "Name" and "Remarks" were specified in the Simple Features interfaces, so they have been kept here. This specification does not dictate what the contents of these items should be. However, the following guidelines are suggested:

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux
See Also:
CS_Info, Serialized Form

Nested Class Summary
(package private)  class Info.AngularUnit
          OpenGIS angular unit.
(package private)  class Info.Export
          Wrap a Info object for use with OpenGIS.
(package private)  class Info.LinearUnit
          OpenGIS linear unit.
 
Field Summary
private  java.lang.String name
          The non-localized object name.
(package private) static WeakHashSet pool
          Set of weak references to existing coordinate systems.
private  java.util.Map properties
          Properties for all methods except getName(java.util.Locale).
private  java.lang.Object proxy
          OpenGIS object returned by cachedOpenGIS(java.lang.Object).
private static long serialVersionUID
          Serial number for interoperability with different versions.
 
Constructor Summary
(package private) Info(java.util.Map properties)
          Create an object with the specified properties.
  Info(java.lang.String name)
          Create an object with the specified name.
 
Method Summary
(package private)  java.lang.String addString(java.lang.StringBuffer buffer)
          Add more information inside the "[...]" part of toString().
(package private)  void addUnit(java.lang.StringBuffer buffer, Unit unit)
          Add a unit in WKT form.
(package private)  java.lang.Object cachedOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this info.
(package private) static void ensureAngularUnit(Unit unit)
          Make sure that the specified unit is an angular one.
(package private) static void ensureLinearUnit(Unit unit)
          Make sure that the specified unit is a linear one.
protected static void ensureNonNull(java.lang.String name, java.lang.Object object)
          Make sure an argument is non-null.
(package private) static void ensureNonNull(java.lang.String name, java.lang.Object[] array, int index)
          Make sure an array element is non-null.
(package private) static void ensureTimeUnit(Unit unit)
          Make sure that the specified unit is a temporal one.
 boolean equals(java.lang.Object object)
          Compares the specified object with this info for equality.
 java.lang.String getAbbreviation(java.util.Locale locale)
          Gets the abbreviation, or null if there is none.
 java.lang.String getAlias(java.util.Locale locale)
          Gets the alias, or null if there is none.
 java.lang.String getAuthority(java.util.Locale locale)
          Gets the authority name, or null if unspecified.
 java.lang.String getAuthorityCode(java.util.Locale locale)
          Gets the authority-specific identification code, or null if unspecified.
 java.lang.String getName(java.util.Locale locale)
          Gets the name of this object.
 java.lang.String getRemarks(java.util.Locale locale)
          Gets the provider-supplied remarks, or null if there is none.
 int hashCode()
          Returns a hash value for this info.
(package private)  java.lang.Object readResolve()
          Returns a reference to an unique instance of this Info.
(package private)  java.lang.Object toOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this info.
 java.lang.String toString()
          Returns a Well Know Text (WKT) for this info.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial number for interoperability with different versions.

See Also:
Constant Field Values

pool

static final WeakHashSet pool
Set of weak references to existing coordinate systems. This set is used in order to return pre-existing object instead of creating new one.


name

private final java.lang.String name
The non-localized object name.


properties

private final java.util.Map properties
Properties for all methods except getName(java.util.Locale). For example the method getAuthorityCode(java.util.Locale) returns the value of property "authorityCode". May be null if there is no properties for this object.


proxy

private transient java.lang.Object proxy
OpenGIS object returned by cachedOpenGIS(java.lang.Object). It may be a hard or a weak reference.

Constructor Detail

Info

public Info(java.lang.String name)
Create an object with the specified name.

Parameters:
name - This object name.

Info

Info(java.util.Map properties)
Create an object with the specified properties. Property keys are any of the following strings: Values are usually String, or may be null if a particular property is not defined. The "name" property is mandatory.

Parameters:
properties - The set of properties.
Method Detail

getName

public java.lang.String getName(java.util.Locale locale)
Gets the name of this object. The default implementation returns the non-localized name given at construction time.

Parameters:
locale - The desired locale, or null for a default locale. If no string is available for the specified locale, an arbitrary locale is used.
See Also:
CS_Info.getName()

getAuthority

public java.lang.String getAuthority(java.util.Locale locale)
Gets the authority name, or null if unspecified. An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is '4326'.

Parameters:
locale - The desired locale, or null for the default locale. If no string is available for the specified locale, an arbitrary locale is used.
See Also:
CS_Info.getAuthority()

getAuthorityCode

public java.lang.String getAuthorityCode(java.util.Locale locale)
Gets the authority-specific identification code, or null if unspecified. The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is '4326'.

Parameters:
locale - The desired locale, or null for the default locale. If no string is available for the specified locale, an arbitrary locale is used.
See Also:
CS_Info.getAuthorityCode()

getAlias

public java.lang.String getAlias(java.util.Locale locale)
Gets the alias, or null if there is none.

Parameters:
locale - The desired locale, or null for the default locale. If no string is available for the specified locale, an arbitrary locale is used.
See Also:
CS_Info.getAlias()

getAbbreviation

public java.lang.String getAbbreviation(java.util.Locale locale)
Gets the abbreviation, or null if there is none.

Parameters:
locale - The desired locale, or null for the default locale. If no string is available for the specified locale, an arbitrary locale is used.
See Also:
CS_Info.getAbbreviation()

getRemarks

public java.lang.String getRemarks(java.util.Locale locale)
Gets the provider-supplied remarks, or null if there is none.

Parameters:
locale - The desired locale, or null for the default locale. If no string is available for the specified locale, an arbitrary locale is used.
See Also:
CS_Info.getRemarks()

hashCode

public int hashCode()
Returns a hash value for this info.


equals

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


toString

public java.lang.String toString()
Returns a Well Know Text (WKT) for this info. "Well know text" are part of OpenGIS's specification.


addString

java.lang.String addString(java.lang.StringBuffer buffer)
Add more information inside the "[...]" part of toString(). The default implementation add nothing. Subclasses will override this method in order to complete string representation.

Parameters:
buffer - The buffer to add string to.
Returns:
The WKT code name (e.g. "GEOGCS").

addUnit

final void addUnit(java.lang.StringBuffer buffer,
                   Unit unit)
Add a unit in WKT form.


ensureNonNull

protected static void ensureNonNull(java.lang.String name,
                                    java.lang.Object object)
                             throws java.lang.IllegalArgumentException
Make sure an argument is non-null. This is a convenience method for subclasses constructors.

Parameters:
name - Argument name.
object - User argument.
Throws:
java.lang.IllegalArgumentException - if object is null.

ensureNonNull

static void ensureNonNull(java.lang.String name,
                          java.lang.Object[] array,
                          int index)
                   throws java.lang.IllegalArgumentException
Make sure an array element is non-null.

Parameters:
name - Argument name.
array - User argument.
index - Element to check.
Throws:
java.lang.IllegalArgumentException - if array[i] is null.

ensureTimeUnit

static void ensureTimeUnit(Unit unit)
                    throws java.lang.IllegalArgumentException
Make sure that the specified unit is a temporal one.

Parameters:
unit - Unit to check.
Throws:
java.lang.IllegalArgumentException - if unit is not a temporal unit.

ensureLinearUnit

static void ensureLinearUnit(Unit unit)
                      throws java.lang.IllegalArgumentException
Make sure that the specified unit is a linear one.

Parameters:
unit - Unit to check.
Throws:
java.lang.IllegalArgumentException - if unit is not a linear unit.

ensureAngularUnit

static void ensureAngularUnit(Unit unit)
                       throws java.lang.IllegalArgumentException
Make sure that the specified unit is an angular one.

Parameters:
unit - Unit to check.
Throws:
java.lang.IllegalArgumentException - if unit is not an angular unit.

readResolve

java.lang.Object readResolve()
                       throws java.io.ObjectStreamException
Returns a reference to an unique instance of this Info. This method is automatically invoked during deserialization. NOTE ABOUT ACCESS-MODIFIER: This method can't be private, because it would prevent it from being invoked from subclasses in this package (e.g. CoordinateSystem). This method will not be invoked for classes outside this package, unless we give it protected access. TODO: Would it be a good idea?

Throws:
java.io.ObjectStreamException

toOpenGIS

java.lang.Object toOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this info. The returned object is suitable for RMI use. Note: The returned type is a generic Object in order to avoid too early class loading of OpenGIS interface.


cachedOpenGIS

final java.lang.Object cachedOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this info. This method first look in the cache. If no interface was previously cached, then this method create a new adapter and cache the result.

Parameters:
adapters - The originating Adapters.