Class DefaultObjectDomain

Object
FormattableObject
DefaultObjectDomain
All Implemented Interfaces:
Serializable, Lenient­Comparable, Printable

public class DefaultObjectDomain extends FormattableObject implements LenientComparable, Serializable
Scope and domain of validity of a CRS-related object. Those two properties are mandatory according ISO 19111. If a property is unspecified (by passing null to the constructor), then this class substitutes the null value by a "not known" text in an object implementing the Nil­Object interface with Nil­Reason​.UNKNOWN. The use of "not known" text is an ISO 19111 recommendation.
Note on International Standard versions
This class is derived from a new type defined in the ISO 19111 international standard published in 2019, while GeoAPI 3.0 is based on the version published in 2007. Consequently this implementation class does not yet implement a GeoAPI interface, but is expected to do so after the next GeoAPI releases. When the interface will become available, all references to this implementation class in Apache SIS will be replaced be references to the Object­Domain interface.

Immutability and thread safety

This class is immutable and thus thread-safe if the property values given to the constructor are also immutable.
Since:
1.4
See Also:
  • Field Details

    • scope

      protected final InternationalString scope
      Description of domain of usage, or limitations of usage, for which the object is valid. This is null (i.e. is not replaced by the "not known" text) if the value given to the constructor was null.
      See Also:
    • domainOfValidity

      protected final Extent domainOfValidity
      Area for which the object is valid. This is null (i.e. is not replaced by the "not known" text) if the value given to the constructor was null.
      See Also:
  • Constructor Details

    • DefaultObjectDomain

      public DefaultObjectDomain(InternationalString scope, Extent domainOfValidity)
      Creates a new domain with the given scope and extent. If any value is null, the text will be set to "not known" (potentially localized). The "not known" text is standardized by ISO 19111 for the scope.
      Parameters:
      scope - description of domain of usage, or limitations of usage.
      domain­Of­Validity - area for which the object is valid.
  • Method Details

    • getScope

      public InternationalString getScope()
      Returns a description of usage, or limitations of usage, for which this object is valid. If no scope was specified to the constructor, then this method returns "not known" in an instance implementing the Nil­Object interface with Nil­Reason​.UNKNOWN.
      Returns:
      the domain of usage.
    • getDomainOfValidity

      public Extent getDomainOfValidity()
      Returns the spatial and temporal extent in which this object is valid. If no extent was specified to the constructor, then this method returns "not known" in an instance implementing the Nil­Object interface with Nil­Reason​.UNKNOWN.
      Returns:
      the area or time frame of usage.
    • equals

      public final boolean equals(Object object)
      Compares the specified object with this object for equality. This method is implemented as below (omitting assertions):
      return equals(other, ComparisonMode.STRICT);
      
      Subclasses shall override equals(Object, Comparison­Mode) instead of this method.
      Specified by:
      equals in interface Lenient­Comparable
      Overrides:
      equals in class Object
      Parameters:
      object - the other object (may be null).
      Returns:
      true if both objects are equal.
      See Also:
    • equals

      public boolean equals(Object object, ComparisonMode mode)
      Compares this object system with the specified object for equality.
      Specified by:
      equals in interface Lenient­Comparable
      Parameters:
      object - the object to compare to this.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code value for this domain.
      Overrides:
      hash­Code in class Object
      Returns:
      a hash code value.
    • formatTo

      protected String formatTo(Formatter formatter)
      Formats the inner part of the Well Known Text (WKT) representation for this object. The default implementation writes the following elements:
      • The object scope.
      • The geographic description of the domain of validity.
      • The geographic bounding box of the domain of validity.
      Specified by:
      format­To in class Formattable­Object
      Parameters:
      formatter - the formatter where to format the inner content of this WKT element.
      Returns:
      the CamelCase keyword for the WKT element, or null if unknown.
      See Also: