Class SimpleIdentifiedObject

Object
SimpleIdentifiedObject
All Implemented Interfaces:
Identifier, IdentifiedObject, ReferenceIdentifier
Direct Known Subclasses:
SimpleAxis, SimpleCRS, SimpleDatum, SimpleParameter, SimpleParameterGroup, SimpleTransform

public class SimpleIdentifiedObject extends Object implements IdentifiedObject, ReferenceIdentifier
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 Identifier interface. Consequently, this class can also be used as an Identifier implementation.

Since:
3.1
  • Field Details

  • Constructor Details

    • 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 Details

    • getName

      public ReferenceIdentifier getName()
      Returns the name of this identified object, which is represented directly by this implementation class.
      Specified by:
      getName in interface IdentifiedObject
      Returns:
      the primary name.
    • getAuthority

      public Citation getAuthority()
      Returns the person or party responsible for maintenance of the namespace. 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 identifier or namespace in which the code is valid. The default implementation returns the title of the authority.
      Specified by:
      getCodeSpace in interface Identifier
      Returns:
      the identifier or namespace in which the code is valid, 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.
    • 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.
    • 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.
      See Also:
    • 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 equal to this object.
    • toString

      public String toString()
      Returns a string representation of the name identifier. The default implementation build the string representation as below:
      • If this identifier has a code space, then returns the concatenation of the code space, the ':' character, then the code.
      • Otherwise returns the code directly.
      Overrides:
      toString in class Object