# Class AbstractReferenceSystem

Object
FormattableObject
AbstractIdentifiedObject
AbstractReferenceSystem

All Implemented Interfaces:
  `Serializable`, `Formattable`, `Deprecable`, `LenientComparable`, `Printable`, `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 the `AbstractCRS` subclass.

This class inherits the name, aliases, identifiers, domains and remarks from the parent class.

## 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 by `Default` 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
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class AbstractIdentifiedObject

  `DEPRECATED_KEY, DOMAINS_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.
  `protected`
  `AbstractReferenceSystem(ReferenceSystem object)`
  Constructs a new reference system with the same values as the specified one.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Extent`
  `getDomainOfValidity()`
  Deprecated.
  Replaced by `AbstractIdentifiedObject​.getDomains()` as of ISO 19111:2019.
  `Class<? extends ReferenceSystem>`
  `getInterface()`
  Returns the GeoAPI interface implemented by this class.
  `InternationalString`
  `getScope()`
  Deprecated.
  Replaced by `AbstractIdentifiedObject​.getDomains()` as of ISO 19111:2019.

  ### Methods inherited from class AbstractIdentifiedObject

  `castOrCopy, computeHashCode, equals, equals, formatTo, formatTo, getAlias, getDescription, getDomains, 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 Details

  - ### AbstractReferenceSystem

    public AbstractReferenceSystem(Map<String,?> properties)
    Constructs a reference system from the given properties. The properties given in argument follow the same rules as for the super-class constructor. The following table is a reminder of main (not all) properties:

    Recognized properties (non exhaustive list)
    Property name | Value type | Returned by
    --- | --- | ---
    "name" | `ReferenceIdentifier` or `String` | `AbstractIdentifiedObject.getName()`
    "alias" | `GenericName` or `CharSequence` (optionally as array) | `AbstractIdentifiedObject.getAlias()`
    "identifiers" | `ReferenceIdentifier` (optionally as array) | `AbstractIdentifiedObject.getIdentifiers()`
    "domains" | `DefaultObjectDomain` (optionally as array) | `AbstractIdentifiedObject.getDomains()`
    "remarks" | `InternationalString` or `String` | `AbstractIdentifiedObject.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 as 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 Details

  - ### getInterface

    public Class<? extends ReferenceSystem> getInterface()
    Returns the GeoAPI interface implemented by this class. The default implementation returns `ReferenceSystem​.class`. Subclasses implementing a more specific GeoAPI interface shall override this method.
    Overrides:
      `getInterface` in class `AbstractIdentifiedObject`
    Returns:
      the GeoAPI interface implemented by this class.

  - ### getDomainOfValidity

    @Deprecated(since="1.4") public Extent getDomainOfValidity()
    Deprecated.
    Replaced by `AbstractIdentifiedObject​.getDomains()` as of ISO 19111:2019.
    Returns the region or timeframe in which this reference system is valid, or `null` if unspecified.
    Specified by:
      `getDomainOfValidity` in interface `ReferenceSystem`
    Returns:
      area or region or timeframe in which this (coordinate) reference system is valid, or `null`.

  - ### getScope

    @Deprecated(since="1.4") public InternationalString getScope()
    Deprecated.
    Replaced by `AbstractIdentifiedObject​.getDomains()` as of ISO 19111:2019.
    Returns the domain or limitations of usage, or `null` if unspecified.
    Specified by:
      `getScope` in interface `ReferenceSystem`
    Returns:
      description of domain of usage, or limitations of usage, for which this (coordinate) reference system object is valid, or `null`.