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
AnIdentifiedObjectabstract base class, which contain only the name attribute. All otherIdentifiedObjectattributes arenullor empty collections.Since the name is the only identifier contained by this class,
SimpleIdentifiedObjectimplements directly theIdentifierinterface. Consequently this class can also be used as anIdentifierimplementation.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CitationauthorityReturns the organization or party responsible for definition and maintenance of the code.protected StringcodeAlphanumeric 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 booleanequals(Object object)Compares this identifier with the given object for equality.CitationgetAuthority()Returns the person or party responsible for maintenance of the namespace.StringgetCode()Returns the name given at construction time.StringgetCodeSpace()Returns the identifier or namespace in which the code is valid.ExtentgetDomainOfValidity()Area or region or timeframe in which this object is valid.ReferenceIdentifiergetName()Returns the name of this identified object, which is represented directly bythisimplementation class.InternationalStringgetScope()Description of domain of usage, or limitations of usage, for which this object is valid.inthashCode()Returns a hash code value calculated from the name identifier.StringtoString()Returns a string representation of the name identifier.StringtoWKT()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(), ornullif 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 bythisimplementation class. This is the onlyIdentifiedObjectmethod in this class returning a non-null and non-empty value.- Specified by:
getNamein 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:
getAuthorityin interfaceIdentifier- Returns:
- party responsible for definition and maintenance of the code, or
nullif 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:
getCodeSpacein interfaceIdentifier- Returns:
- the identifier or namespace in which the code is valid, or
nullif none.
-
getCode
public String getCode()
Returns the name given at construction time.- Specified by:
getCodein 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
nullif 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
nullif 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:
toWKTin 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
-
-