Package org.opengis.example.referencing
Class SimpleIdentifiedObject
- Object
-
- 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
AnIdentifiedObject
abstract base class, which contain only the name attribute. All otherIdentifiedObject
attributes arenull
or empty collections.Since the name is the only identifier contained by this class,
SimpleIdentifiedObject
implements directly theIdentifier
interface. Consequently this class can also be used as anIdentifier
implementation.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description 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 Identifier
AUTHORITY_KEY, CODE_KEY, CODESPACE_KEY, DESCRIPTION_KEY, VERSION_KEY
-
-
Constructor Summary
Constructors Constructor Description SimpleIdentifiedObject(Citation authority, String name)
Creates a new object of the given authority and name.
-
Method Summary
Modifier and Type Method Description boolean
equals(Object object)
Compares this identifier with the given object for equality.Citation
getAuthority()
Returns the person or party responsible for maintenance of the namespace.String
getCode()
Returns the name given at construction time.String
getCodeSpace()
Returns the identifier or namespace in which the code is valid.Extent
getDomainOfValidity()
Area or region or timeframe in which this object is valid.ReferenceIdentifier
getName()
Returns the name of this identified object, which is represented directly bythis
implementation class.InternationalString
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.String
toString()
Returns a string representation of the name identifier.String
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 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()
-
-
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 bygetAuthority()
, ornull
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 bythis
implementation class. This is the onlyIdentifiedObject
method in this class returning a non-null and non-empty value.- Specified by:
getName
in interfaceIdentifiedObject
-
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 interfaceIdentifier
- 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 interfaceIdentifier
- 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 interfaceIdentifier
- 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 fromIdentifiedObject
, but is defined in sub-interfaces likeSingleCRS
.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 fromIdentifiedObject
, but is defined in sub-interfaces likeSingleCRS
.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 interfaceIdentifiedObject
- 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.
-
equals
public boolean equals(Object object)
Compares this identifier with the given object for equality.
-
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.
- If this identifier has a code space, then returns
the concatenation of the code space, the
-
-