Package org.apache.sis.referencing
Class AbstractReferenceSystem
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.AbstractReferenceSystem
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.ReferenceSystem
- Direct Known Subclasses:
AbstractCRS
,ReferencingByIdentifiers
public class AbstractReferenceSystem
extends AbstractIdentifiedObject
implements org.opengis.referencing.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 the
AbstractCRS
subclass.
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.
Instantiation
This class is conceptually abstract, even if it is technically possible to instantiate it. Typical applications should create instances of the most specific subclass prefixed byDefault
instead.
Immutability and thread safety
This 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,ReferenceSystem
instances created using
only SIS factories and static constants can be shared by many objects and passed between threads without
synchronization.- Since:
- 0.4
- Version:
- 0.7
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.metadata.extent.Extent
Area for which the (coordinate) reference system is valid.private org.opengis.util.InternationalString
Description of domain of usage, or limitations of usage, for which this (coordinate) reference system object is valid.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface org.opengis.referencing.ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
Constructs a new object in which every attributes are set to a null value.AbstractReferenceSystem
(Map<String, ?> properties) Constructs a reference system from the given properties.protected
AbstractReferenceSystem
(org.opengis.referencing.ReferenceSystem object) Constructs a new reference system with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Invoked byhashCode()
for computing the hash code when first needed.boolean
equals
(Object object, ComparisonMode mode) Compares this reference system with the specified object for equality.org.opengis.metadata.extent.Extent
Returns the region or timeframe in which this reference system is valid, ornull
if unspecified.Class<? extends org.opengis.referencing.ReferenceSystem>
Returns the GeoAPI interface implemented by this class.org.opengis.util.InternationalString
getScope()
Returns the domain or limitations of usage, ornull
if unspecified.private void
setDomainOfValidity
(org.opengis.metadata.extent.Extent value) Invoked by JAXB only at unmarshalling time.private void
setScope
(org.opengis.util.InternationalString value) Invoked by JAXB only at unmarshalling time.Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, formatTo, getAlias, getDescription, getID, getIdentifier, getIdentifiers, getName, getNames, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
domainOfValidity
private org.opengis.metadata.extent.Extent domainOfValidityArea for which the (coordinate) reference system is valid.Consider this field as final! This field is modified only at unmarshalling time by
setDomainOfValidity(Extent)
- See Also:
-
scope
private org.opengis.util.InternationalString scopeDescription of domain of usage, or limitations of usage, for which this (coordinate) reference system object is valid.Consider this field as final! This field is modified only at unmarshalling time by
setScope(InternationalString)
- See Also:
-
-
Constructor Details
-
AbstractReferenceSystem
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" Extent
getDomainOfValidity()
"scope" String
orInternationalString
getScope()
Defined in parent class (reminder) "name" ReferenceIdentifier
orString
AbstractIdentifiedObject.getName()
"alias" GenericName
orCharSequence
(optionally as array)AbstractIdentifiedObject.getAlias()
"identifiers" ReferenceIdentifier
(optionally as array)AbstractIdentifiedObject.getIdentifiers()
"remarks" InternationalString
orString
AbstractIdentifiedObject.getRemarks()
- Parameters:
properties
- the properties to be given to this object.
-
AbstractReferenceSystem
protected AbstractReferenceSystem(org.opengis.referencing.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.
-
AbstractReferenceSystem
AbstractReferenceSystem()Constructs a new object in which every attributes are set to a null value. This is not a valid object. This constructor is strictly reserved to JAXB, which will assign values to the fields using reflection.
-
-
Method Details
-
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:
getInterface
in classAbstractIdentifiedObject
- Returns:
- the GeoAPI interface implemented by this class.
-
getDomainOfValidity
@Workaround(library="JDK", version="1.8") public org.opengis.metadata.extent.Extent getDomainOfValidity()Returns the region or timeframe in which this reference system is valid, ornull
if unspecified.- Specified by:
getDomainOfValidity
in interfaceorg.opengis.referencing.ReferenceSystem
- Returns:
- area or region or timeframe in which this (coordinate) reference system is valid, or
null
. - See Also:
-
getScope
public org.opengis.util.InternationalString getScope()Returns the domain or limitations of usage, ornull
if unspecified.- Specified by:
getScope
in interfaceorg.opengis.referencing.ReferenceSystem
- Returns:
- description of domain of usage, or limitations of usage, for which this
(coordinate) reference system object is valid, or
null
.
-
equals
Compares this reference system with the specified object for equality. If themode
argument value isSTRICT
orBY_CONTRACT
, then all available properties are compared including the domain of validity and the scope.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractIdentifiedObject
- Parameters:
object
- the object to compare tothis
.mode
-STRICT
for performing a strict comparison, orIGNORE_METADATA
for comparing only properties relevant to coordinate transformations.- Returns:
true
if both objects are equal.- See Also:
-
computeHashCode
protected long computeHashCode()Invoked byhashCode()
for computing the hash code when first needed. SeeAbstractIdentifiedObject.computeHashCode()
for more information.- Overrides:
computeHashCode
in classAbstractIdentifiedObject
- Returns:
- the hash code value. This value may change in any future Apache SIS version.
-
setDomainOfValidity
private void setDomainOfValidity(org.opengis.metadata.extent.Extent value) Invoked by JAXB only at unmarshalling time.- See Also:
-
setScope
private void setScope(org.opengis.util.InternationalString value) Invoked by JAXB only at unmarshalling time.- See Also:
-