Package org.apache.sis.referencing
Class AbstractReferenceSystem
- Object
-
- FormattableObject
-
- AbstractIdentifiedObject
-
- AbstractReferenceSystem
-
- All Implemented Interfaces:
Serializable,Deprecable,LenientComparable,IdentifiedObject,ReferenceSystem
- Direct Known Subclasses:
AbstractCRS,ReferencingByIdentifiers
public class AbstractReferenceSystem extends AbstractIdentifiedObject implements ReferenceSystem
Description of a spatial and temporal reference system used by a dataset. Reference systems do not necessarily use coordinates. For example a reference system could use postal codes. The specialized case of referencing by coordinates is handled by theAbstractCRSsubclass.This class inherits the name, aliases, identifiers and remarks from the parent class, and adds the following information:
- a domain of validity, the area for which the reference system is valid,
- a scope, which describes the domain of usage or limitation of usage.
InstantiationThis class is conceptually abstract, even if it is technically possible to instantiate it. Typical applications should create instances of the most specific subclass prefixed byDefaultinstead.Immutability and thread safetyThis base class is immutable and thus thread-safe if the property values (not necessarily the map itself) given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar conditions. This means that unless otherwise noted in the javadoc,ReferenceSysteminstances created using only SIS factories and static constants can be shared by many objects and passed between threads without synchronization.- Since:
- 0.4
- See Also:
- Serialized Form
Defined in the
sis-referencingmodule
-
-
Field Summary
-
Fields inherited from class AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
-
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Fields inherited from interface ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractReferenceSystem(Map<String,?> properties)Constructs a reference system from the given properties.protectedAbstractReferenceSystem(ReferenceSystem object)Constructs a new reference system with the same values than the specified one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longcomputeHashCode()Invoked byhashCode()for computing the hash code when first needed.booleanequals(Object object, ComparisonMode mode)Compares this reference system with the specified object for equality.ExtentgetDomainOfValidity()Returns the region or timeframe in which this reference system is valid, ornullif unspecified.Class<? extends ReferenceSystem>getInterface()Returns the GeoAPI interface implemented by this class.InternationalStringgetScope()Returns the domain or limitations of usage, ornullif unspecified.-
Methods inherited from class AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
-
Methods inherited from class FormattableObject
print, toString, toString, toWKT
-
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
-
-
-
Constructor Detail
-
AbstractReferenceSystem
public AbstractReferenceSystem(Map<String,?> properties)
Constructs a reference system from the given properties. The properties given in argument follow the same rules than for the super-class constructor. Additionally, the following properties are understood by this constructor:Recognized properties (non exhaustive list) Property name Value type Returned by "domainOfValidity" ExtentgetDomainOfValidity()"scope" StringorInternationalStringgetScope()Defined in parent class (reminder) "name" ReferenceIdentifierorStringAbstractIdentifiedObject.getName()"alias" GenericNameorCharSequence(optionally as array)AbstractIdentifiedObject.getAlias()"identifiers" ReferenceIdentifier(optionally as array)AbstractIdentifiedObject.getIdentifiers()"remarks" InternationalStringorStringAbstractIdentifiedObject.getRemarks()- Parameters:
properties- the properties to be given to this object.
-
AbstractReferenceSystem
protected AbstractReferenceSystem(ReferenceSystem object)
Constructs a new reference system with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.This constructor performs a shallow copy, i.e. the properties are not cloned.
- Parameters:
object- the reference system to copy.
-
-
Method Detail
-
getInterface
public Class<? extends ReferenceSystem> getInterface()
Returns the GeoAPI interface implemented by this class. The default implementation returnsReferenceSystem.class. Subclasses implementing a more specific GeoAPI interface shall override this method.- Overrides:
getInterfacein classAbstractIdentifiedObject- Returns:
- the GeoAPI interface implemented by this class.
-
getDomainOfValidity
@Workaround(library="JDK", version="1.8") public Extent getDomainOfValidity()
Returns the region or timeframe in which this reference system is valid, ornullif unspecified.- Specified by:
getDomainOfValidityin interfaceReferenceSystem- Returns:
- area or region or timeframe in which this (coordinate) reference system is valid, or
null. - See Also:
DefaultExtent
-
getScope
public InternationalString getScope()
Returns the domain or limitations of usage, ornullif unspecified.- Specified by:
getScopein interfaceReferenceSystem- Returns:
- description of domain of usage, or limitations of usage, for which this
(coordinate) reference system object is valid, or
null.
-
equals
public boolean equals(Object object, ComparisonMode mode)
Compares this reference system with the specified object for equality. If themodeargument value isSTRICTorBY_CONTRACT, then all available properties are compared including the domain of validity and the scope.- Specified by:
equalsin interfaceLenientComparable- Overrides:
equalsin classAbstractIdentifiedObject- Parameters:
object- the object to compare tothis.mode-STRICTfor performing a strict comparison, orIGNORE_METADATAfor comparing only properties relevant to coordinate transformations.- Returns:
trueif both objects are equal.- See Also:
AbstractIdentifiedObject.computeHashCode(),Utilities.deepEquals(Object, Object, ComparisonMode)
-
computeHashCode
protected long computeHashCode()
Invoked byhashCode()for computing the hash code when first needed. SeeAbstractIdentifiedObject.computeHashCode()for more information.- Overrides:
computeHashCodein classAbstractIdentifiedObject- Returns:
- the hash code value. This value may change in any future Apache SIS version.
-
-