org.opengis.example.referencing
Class SimpleIdentifiedObject

Show UML class diagram
Object
  extended by SimpleIdentifiedObject
All Implemented Interfaces:
Serializable, Identifier, IdentifiedObject, ReferenceIdentifier
Direct Known Subclasses:
SimpleAxis, SimpleCRS, SimpleDatum, SimpleParameter, SimpleParameterGroup, SimpleTransform

public class SimpleIdentifiedObject
extends Object
implements IdentifiedObject, ReferenceIdentifier, Serializable

An IdentifiedObject abstract base class, which contain only the name attribute. All other IdentifiedObject attributes are null or empty collections.

Since the name is the only identifier contained by this class, SimpleIdentifiedObject implements directly the ReferenceIdentifier interface. Consequently this class can also be used as a ReferenceIdentifier implementation.

Since:
3.1
See Also:
Serialized Form

Field Summary
protected  Citation authority
          Returns the organization or party responsible for definition and maintenance of the code.
protected  String code
          Alphanumeric value identifying an instance in the authority name space.
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Fields inherited from interface ReferenceIdentifier
CODESPACE_KEY, VERSION_KEY
 
Fields inherited from interface Identifier
AUTHORITY_KEY, CODE_KEY
 
Constructor Summary
SimpleIdentifiedObject(Citation authority, String name)
          Creates a new object of the given authority and name.
 
Method Summary
 boolean equals(Object object)
          Compares this identifier with the given object for equality.
 Collection<GenericName> getAlias()
          Alternative names by which this object is identified.
 Citation getAuthority()
          Returns the organization or party responsible for definition and maintenance of the code.
 String getCode()
          Returns the name given at construction time.
 String getCodeSpace()
          Returns the name or identifier of the person or organization responsible for namespace.
 Extent getDomainOfValidity()
          Area or region or timeframe in which this object is valid.
 Set<ReferenceIdentifier> getIdentifiers()
          An identifier which references elsewhere the object's defining information.
 ReferenceIdentifier getName()
          Returns the name of this identified object, which is represented directly by this implementation class.
 InternationalString getRemarks()
          Comments on or information about this object, including data source information.
 InternationalString getScope()
          Description of domain of usage, or limitations of usage, for which this object is valid.
 String getVersion()
          Version identifier for the namespace, as specified by the code authority.
 int hashCode()
          Returns a hash code value calculated from the name identifier.
 String toString()
          Returns a string representation of the name identifier.
 String toWKT()
          Returns a Well Known Text (WKT) for this object.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

authority

protected final Citation authority
Returns the organization or party responsible for definition and maintenance of the code. The citation title will be used as code space.

See Also:
getAuthority(), getCodeSpace()

code

protected final String code
Alphanumeric value identifying an instance in the authority name space.

See Also:
getCode()
Constructor Detail

SimpleIdentifiedObject

public SimpleIdentifiedObject(Citation authority,
                              String name)
Creates a new object of the given authority and name.

Parameters:
authority - The value to be returned by getAuthority(), or null if none.
name - The name of the new object.
Method Detail

getName

public ReferenceIdentifier getName()
Returns the name of this identified object, which is represented directly by this implementation class. This is the only IdentifiedObject method in this class returning a non-null and non-empty value.

Specified by:
getName in interface IdentifiedObject

getAuthority

public Citation getAuthority()
Returns the organization or party responsible for definition and maintenance of the code. This method returns the citation given to the constructor.

Specified by:
getAuthority in interface Identifier
Returns:
Party responsible for definition and maintenance of the code, or null if none.

getCodeSpace

public String getCodeSpace()
Returns the name or identifier of the person or organization responsible for namespace. The default implementation returns the title of the authority.

Specified by:
getCodeSpace in interface ReferenceIdentifier
Returns:
The identifier code space, or null if none.

getCode

public String getCode()
Returns the name given at construction time.

Specified by:
getCode in interface Identifier
Returns:
Alphanumeric value identifying an instance in the namespace.

getVersion

public String getVersion()
Version identifier for the namespace, as specified by the code authority. The default implementation returns null.

Specified by:
getVersion in interface ReferenceIdentifier

getAlias

public Collection<GenericName> getAlias()
Alternative names by which this object is identified. The default implementation returns an empty set.

Specified by:
getAlias in interface IdentifiedObject
Returns:
The aliases, or an empty collection if there is none.

getIdentifiers

public Set<ReferenceIdentifier> getIdentifiers()
An identifier which references elsewhere the object's defining information. Alternatively an identifier by which this object can be referenced. The default implementation returns an empty set.

Specified by:
getIdentifiers in interface IdentifiedObject
Returns:
This object identifiers, or an empty set if there is none.

getScope

public InternationalString getScope()
Description of domain of usage, or limitations of usage, for which this object is valid. Note that this method is not inherited from IdentifiedObject, but is defined in sub-interfaces like SingleCRS.

The default implementation returns null.

Returns:
The domain of usage, or null if none.

getDomainOfValidity

public Extent getDomainOfValidity()
Area or region or timeframe in which this object is valid. Note that this method is not inherited from IdentifiedObject, but is defined in sub-interfaces like SingleCRS.

The default implementation returns null.

Returns:
The valid domain, or null if not available.

getRemarks

public InternationalString getRemarks()
Comments on or information about this object, including data source information. The default implementation returns null.

Specified by:
getRemarks in interface IdentifiedObject
Returns:
The remarks, or null if none.

toWKT

public String toWKT()
             throws UnsupportedOperationException
Returns a Well Known Text (WKT) for this object. The default implementation throws unconditionally the exception since we do not support WKT formatting.

Specified by:
toWKT in interface IdentifiedObject
Returns:
The Well Know Text for this object.
Throws:
UnsupportedOperationException - If this object can't be formatted as WKT.

hashCode

public int hashCode()
Returns a hash code value calculated from the name identifier. This hash code calculation is sufficient if each object name is unique.

Overrides:
hashCode in class Object

equals

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

Overrides:
equals in class Object
Parameters:
object - The object to compare with this SimpleIdentifiedObject.
Returns:
true if the given object is equals to this object.

toString

public String toString()
Returns a string representation of the name identifier. The default implementation build the string representation as below:

Overrides:
toString in class Object


Copyright © 1994-2013 Open Geospatial Consortium. All Rights Reserved.