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.ReferenceIdentifierThe primary name by which this object is identified.private static final longFor cross-version compatibility.Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates 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 booleanCompares this object with the given one for equality.booleanequals(Object object, ComparisonMode mode) Compares this object with the given one for equality.final Collection<org.opengis.util.GenericName>getAlias()Method required by theIdentifiedObjectinterface.final org.opengis.metadata.extent.ExtentMethod required by mostIdentifiedObjectsub-interfaces.final Set<org.opengis.referencing.ReferenceIdentifier>Method required by theIdentifiedObjectinterface.org.opengis.referencing.ReferenceIdentifiergetName()Returns the primary name by which this object is identified.final org.opengis.util.InternationalStringMethod required by theIdentifiedObjectinterface.final org.opengis.util.InternationalStringgetScope()Method required by mostIdentifiedObjectsub-interfaces.final inthashCode()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:
getNamein interfaceorg.opengis.referencing.IdentifiedObject- Returns:
- the identifier given at construction time.
-
getIdentifiers
Method required by theIdentifiedObjectinterface. 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:
getIdentifiersin interfaceorg.opengis.referencing.IdentifiedObject- Returns:
- the identifiers, or an empty set if none.
-
getAlias
Method required by theIdentifiedObjectinterface. 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:
getAliasin 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 mostIdentifiedObjectsub-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
nullif none.
-
getScope
public final org.opengis.util.InternationalString getScope()Method required by mostIdentifiedObjectsub-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
nullif none.
-
getRemarks
public final org.opengis.util.InternationalString getRemarks()Method required by theIdentifiedObjectinterface. Current implementation returnsnull.If a future version allows this method to returns a non-null value, revisit
equals(Object, ComparisonMode).- Specified by:
getRemarksin interfaceorg.opengis.referencing.IdentifiedObject- Returns:
- the remarks, or
nullif 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:
equalsin interfaceLenientComparable- Overrides:
equalsin classObject- Parameters:
object- the object to compare with this reference system.- Returns:
trueif 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:
equalsin interfaceLenientComparable- Parameters:
object- the object to compare with this identified object.mode- the strictness level of the comparison.- Returns:
trueif 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:
toWKTin interfaceorg.opengis.referencing.IdentifiedObject- Returns:
- the Well Known Text.
- Throws:
UnsupportedOperationException- always thrown.
-
toString
Returns a pseudo-WKT representation for debugging purpose.
-