org.geotoolkit.referencing
Class DefaultReferenceIdentifier

Object
  extended by DefaultReferenceIdentifier
All Implemented Interfaces:
Serializable, Deprecable, Identifier, ReferenceIdentifier
Direct Known Subclasses:
NamedIdentifier

@Immutable
public class DefaultReferenceIdentifier
extends Object
implements ReferenceIdentifier, Deprecable, Serializable

An identification of a CoordinateReferenceSystem object.

Since:
3.03 (derived from 2.6)
Version:
3.03
Author:
Martin Desruisseaux (Geomatys)
See Also:
Serialized Form
Module:
metadata/geotk-metadata (download)    View source code for this class

Field Summary
 
Fields inherited from interface ReferenceIdentifier
CODESPACE_KEY, VERSION_KEY
 
Fields inherited from interface Identifier
AUTHORITY_KEY, CODE_KEY
 
Constructor Summary
DefaultReferenceIdentifier(Citation authority, String codeSpace, String code)
          Creates a new identifier from the specified code and authority.
DefaultReferenceIdentifier(Citation authority, String codeSpace, String code, String version, InternationalString remarks)
          Creates a new identifier from the specified code and authority, with an optional version number and remarks.
DefaultReferenceIdentifier(Map<String,?> properties)
          Constructs an identifier from a set of properties.
DefaultReferenceIdentifier(ReferenceIdentifier identifier)
          Creates a new identifier from the specified one.
 
Method Summary
 boolean equals(Object object)
          Compares this object with the given one for equality.
 Citation getAuthority()
          Organization or party responsible for definition and maintenance of the code.
 String getCode()
          Identifier code or name, optionally from a controlled list or pattern.
 String getCodeSpace()
          Name or identifier of the person or organization responsible for namespace.
 InternationalString getRemarks()
          Comments on or information about this identifier, or null if none.
 String getVersion()
          Identifier of the version of the associated code space or code, as specified by the code authority.
 int hashCode()
          Returns a hash code value for this object.
 boolean isDeprecated()
          Returns true if the object represented by this identifier is deprecated.
 String toString()
          Returns a string representation of this identifier.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultReferenceIdentifier

public DefaultReferenceIdentifier(ReferenceIdentifier identifier)
Creates a new identifier from the specified one. This is a copy constructor which will get the code, codespace, authority, version and (if available) the remarks from the given identifier.

Parameters:
identifier - The identifier to copy.

DefaultReferenceIdentifier

public DefaultReferenceIdentifier(Citation authority,
                                  String codeSpace,
                                  String code)
Creates a new identifier from the specified code and authority.

Parameters:
authority - Organization or party responsible for definition and maintenance of the code space or code.
codeSpace - Name or identifier of the person or organization responsible for namespace. This is often an abbreviation of the authority name.
code - Identifier code or name, optionally from a controlled list or pattern defined by a code space. The code can not be null.

DefaultReferenceIdentifier

public DefaultReferenceIdentifier(Citation authority,
                                  String codeSpace,
                                  String code,
                                  String version,
                                  InternationalString remarks)
Creates a new identifier from the specified code and authority, with an optional version number and remarks.

Parameters:
authority - Organization or party responsible for definition and maintenance of the code space or code, or null if not available.
codeSpace - Name or identifier of the person or organization responsible for namespace, or null if not available. This is often an abbreviation of the authority name.
code - Identifier code or name, optionally from a controlled list or pattern defined by a code space. The code can not be null.
version - The version of the associated code space or code as specified by the code authority, or null if none.
remarks - Comments on or information about this identifier, or null if none.

DefaultReferenceIdentifier

public DefaultReferenceIdentifier(Map<String,?> properties)
                           throws IllegalArgumentException
Constructs an identifier from a set of properties. Keys are strings from the table below. Keys are case-insensitive, and leading and trailing spaces are ignored. The map given in argument shall contains at least a "code" property. Other properties listed in the table below are optional.

Property name Value type Value given to
 "code"   String   getCode()
 "codespace"   String   getCodeSpace()
 "authority"   String or Citation   getAuthority()
 "version"   String   getVersion()
 "remarks"   String or InternationalString   getRemarks()

"remarks" is a localizable attributes which may have a language and country code suffix. For example the "remarks_fr" property stands for remarks in French and the "remarks_fr_CA" property stands for remarks in French Canadian.

Parameters:
properties - The properties to be given to this identifier.
Throws:
InvalidParameterValueException - if a property has an invalid value.
IllegalArgumentException - if a property is invalid for some other reason.
Method Detail

getCode

public String getCode()
Identifier code or name, optionally from a controlled list or pattern.

Specified by:
getCode in interface Identifier
Returns:
The code, never null.
See Also:
NamedIdentifier.tip()

getCodeSpace

public String getCodeSpace()
Name or identifier of the person or organization responsible for namespace.

Specified by:
getCodeSpace in interface ReferenceIdentifier
Returns:
The code space, or null if not available.
See Also:
NamedIdentifier.head(), NamedIdentifier.scope()

getAuthority

public Citation getAuthority()
Organization or party responsible for definition and maintenance of the code.

Specified by:
getAuthority in interface Identifier
Returns:
The authority, or null if not available.
See Also:
Citations.EPSG

getVersion

public String getVersion()
Identifier of the version of the associated code space or code, as specified by the code authority. This version is included only when the code uses versions. When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.

Specified by:
getVersion in interface ReferenceIdentifier
Returns:
The version, or null if not available.

getRemarks

public InternationalString getRemarks()
Comments on or information about this identifier, or null if none.

Returns:
Optional comments about this identifier.

isDeprecated

public boolean isDeprecated()
Returns true if the object represented by this identifier is deprecated. In such case, the remarks may contains the new identifier to use.

The default implementation returns false in all cases.

Specified by:
isDeprecated in interface Deprecable
Returns:
true if this code is deprecated.
See Also:
AbstractIdentifiedObject.isDeprecated()

hashCode

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

Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Compares this object with the given one for equality.

Overrides:
equals in class Object
Parameters:
object - The object to compare with this identifier.
Returns:
true if both objects are equal.

toString

public String toString()
Returns a string representation of this identifier. The default implementation returns a pseudo-WKT format.
Note: The NamedIdentifier subclass overrides this method with a different behavior, in order to be compliant with the contract of the GenericName interface.

Overrides:
toString in class Object
See Also:
IdentifiedObjects.toString(Identifier), NamedIdentifier.toString()


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.