Package org.apache.sis.internal.simple
Class SimpleIdentifiedObject
java.lang.Object
org.apache.sis.internal.simple.SimpleIdentifiedObject
- All Implemented Interfaces:
Serializable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
- Direct Known Subclasses:
Parameter
,ReferenceSystemMetadata
public class SimpleIdentifiedObject
extends Object
implements org.opengis.referencing.IdentifiedObject, LenientComparable, Serializable
A trivial implementation of
IdentifiedObject
containing only a primary name.- Since:
- 0.5
- Version:
- 0.5
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opengis.referencing.ReferenceIdentifier
The primary name by which this object is identified.private static final long
For cross-version compatibility.Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates an identified object without identifier.SimpleIdentifiedObject
(org.opengis.referencing.IdentifiedObject object) Creates an identified object with the same identifier than the given one.SimpleIdentifiedObject
(org.opengis.referencing.ReferenceIdentifier name) Creates an identified object with the given identifier. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Compares this object with the given one for equality.boolean
equals
(Object object, ComparisonMode mode) Compares this object with the given one for equality.final Collection<org.opengis.util.GenericName>
getAlias()
Method required by theIdentifiedObject
interface.final org.opengis.metadata.extent.Extent
Method required by mostIdentifiedObject
sub-interfaces.final Set<org.opengis.referencing.ReferenceIdentifier>
Method required by theIdentifiedObject
interface.org.opengis.referencing.ReferenceIdentifier
getName()
Returns the primary name by which this object is identified.final org.opengis.util.InternationalString
Method required by theIdentifiedObject
interface.final org.opengis.util.InternationalString
getScope()
Method required by mostIdentifiedObject
sub-interfaces.final int
hashCode()
Returns a hash code value for this object.toString()
Returns a pseudo-WKT representation for debugging purpose.toWKT()
Throws an exception in all cases, since this object can't be formatted in a valid WKT.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
name
protected org.opengis.referencing.ReferenceIdentifier nameThe primary name by which this object is identified.
-
-
Constructor Details
-
SimpleIdentifiedObject
protected SimpleIdentifiedObject()Creates an identified object without identifier. This constructor is mainly for JAXB. -
SimpleIdentifiedObject
public SimpleIdentifiedObject(org.opengis.referencing.IdentifiedObject object) Creates an identified object with the same identifier than the given one.- Parameters:
object
- the identified object to partially copy.
-
SimpleIdentifiedObject
public SimpleIdentifiedObject(org.opengis.referencing.ReferenceIdentifier name) Creates an identified object with the given identifier.- Parameters:
name
- the primary name by which this object is identified.
-
-
Method Details
-
getName
public org.opengis.referencing.ReferenceIdentifier getName()Returns the primary name by which this object is identified.- Specified by:
getName
in interfaceorg.opengis.referencing.IdentifiedObject
- Returns:
- the identifier given at construction time.
-
getIdentifiers
Method required by theIdentifiedObject
interface. Current implementation returns an empty set.If a future version allows this method to returns a non-empty set, revisit
equals(Object, ComparisonMode)
.- Specified by:
getIdentifiers
in interfaceorg.opengis.referencing.IdentifiedObject
- Returns:
- the identifiers, or an empty set if none.
-
getAlias
Method required by theIdentifiedObject
interface. Current implementation returns an empty set.If a future version allows this method to returns a non-empty set, revisit
equals(Object, ComparisonMode)
.- Specified by:
getAlias
in interfaceorg.opengis.referencing.IdentifiedObject
- Returns:
- the aliases, or an empty set if none.
-
getDomainOfValidity
public final org.opengis.metadata.extent.Extent getDomainOfValidity()Method required by mostIdentifiedObject
sub-interfaces. Current implementation returnsnull
.If a future version allows this method to returns a non-null value, revisit
equals(Object, ComparisonMode)
in subclasses.- Returns:
- the domain of validity, or
null
if none.
-
getScope
public final org.opengis.util.InternationalString getScope()Method required by mostIdentifiedObject
sub-interfaces. Current implementation returnsnull
.If a future version allows this method to returns a non-null value, revisit
equals(Object, ComparisonMode)
in subclasses.- Returns:
- the scope, or
null
if none.
-
getRemarks
public final org.opengis.util.InternationalString getRemarks()Method required by theIdentifiedObject
interface. Current implementation returnsnull
.If a future version allows this method to returns a non-null value, revisit
equals(Object, ComparisonMode)
.- Specified by:
getRemarks
in interfaceorg.opengis.referencing.IdentifiedObject
- Returns:
- the remarks, or
null
if none.
-
hashCode
public final int hashCode()Returns a hash code value for this object. -
equals
Compares this object with the given one for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classObject
- Parameters:
object
- the object to compare with this reference system.- Returns:
true
if both objects are equal.- See Also:
-
equals
Compares this object with the given one for equality. This method compares the name only in "strict" or "by contract" modes. If name is a critical component of this object, then it shall be compared by the subclass. This behavior is consistent withAbstractIdentifiedObject
.- Specified by:
equals
in interfaceLenientComparable
- Parameters:
object
- the object to compare with this identified object.mode
- the strictness level of the comparison.- Returns:
true
if both objects are equal.- See Also:
-
toWKT
Throws an exception in all cases, since this object can't be formatted in a valid WKT.- Specified by:
toWKT
in interfaceorg.opengis.referencing.IdentifiedObject
- Returns:
- the Well Known Text.
- Throws:
UnsupportedOperationException
- always thrown.
-
toString
Returns a pseudo-WKT representation for debugging purpose.
-