Module org.opengis.geoapi.example
Package org.opengis.example.referencing
Class SimpleIdentifiedObject
Object
SimpleIdentifiedObject
- All Implemented Interfaces:
Identifier
,IdentifiedObject
,ReferenceIdentifier
- Direct Known Subclasses:
SimpleAxis
,SimpleCRS
,SimpleDatum
,SimpleParameter
,SimpleParameterGroup
,SimpleTransform
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 Summary
Modifier and TypeFieldDescriptionprotected final Citation
The organization or party responsible for definition and maintenance of the code.protected final String
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 Identifier
AUTHORITY_KEY, CODE_KEY, CODESPACE_KEY, DESCRIPTION_KEY, VERSION_KEY
-
Constructor Summary
ConstructorDescriptionSimpleIdentifiedObject
(Citation authority, String name) Creates a new object of the given authority and name. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this identifier with the given object for equality.Returns the person or party responsible for maintenance of the namespace.getCode()
Returns the name given at construction time.Returns the identifier or namespace in which the code is valid.Area or region or timeframe in which this object is valid.getName()
Returns the name of this identified object, which is represented directly bythis
implementation class.getScope()
Description of domain of usage, or limitations of usage, for which this object is valid.int
hashCode()
Returns a hash code value calculated from the name identifier.toString()
Returns a string representation of the name identifier.toWKT()
Returns a Well-Known Text (WKT) for this object.Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getRemarks
Methods inherited from interface Identifier
getDescription, getVersion
-
Field Details
-
authority
The organization or party responsible for definition and maintenance of the code. The citation title will be used as code space.- See Also:
-
code
Alphanumeric value identifying an instance in the authority name space.- See Also:
-
-
Constructor Details
-
SimpleIdentifiedObject
Creates a new object of the given authority and name.- Parameters:
authority
- the value to be returned bygetAuthority()
, ornull
if none.name
- the name of the new object.
-
-
Method Details
-
getName
Returns the name of this identified object, which is represented directly bythis
implementation class.- Specified by:
getName
in interfaceIdentifiedObject
- Returns:
- the primary name.
-
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 interfaceIdentifier
- Returns:
- party responsible for definition and maintenance of the code, or
null
if none.
-
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 interfaceIdentifier
- Returns:
- the identifier or namespace in which the code is valid, or
null
if none.
-
getCode
Returns the name given at construction time.- Specified by:
getCode
in interfaceIdentifier
- Returns:
- alphanumeric value identifying an instance in the namespace.
-
getScope
Description of domain of usage, or limitations of usage, for which this object is valid. Note that this method is not inherited fromIdentifiedObject
, but is defined in sub-interfaces likeSingleCRS
.The default implementation returns
null
.- Returns:
- the domain of usage, or
null
if none.
-
getDomainOfValidity
Area or region or timeframe in which this object is valid. Note that this method is not inherited fromIdentifiedObject
, but is defined in sub-interfaces likeSingleCRS
.The default implementation returns
null
.- Returns:
- the valid domain, or
null
if not available.
-
toWKT
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 interfaceIdentifiedObject
- 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. -
equals
Compares this identifier with the given object for equality. -
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.
- If this identifier has a code space, then returns
the concatenation of the code space, the
-