Object
FormattableObject
DefaultObjectDomain
- All Implemented Interfaces:
Serializable
,LenientComparable
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 NilObject
interface with NilReason.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
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
ObjectDomain
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 Summary
Modifier and TypeFieldDescriptionprotected final Extent
Area for which the object is valid.protected final InternationalString
Description of domain of usage, or limitations of usage, for which the object is valid. -
Constructor Summary
ConstructorDescriptionDefaultObjectDomain
(InternationalString scope, Extent domainOfValidity) Creates a new domain with the given scope and extent. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Compares the specified object with this object for equality.boolean
equals
(Object object, ComparisonMode mode) Compares this object system with the specified object for equality.protected String
Formats the inner part of the Well Known Text (WKT) representation for this object.Returns the spatial and temporal extent in which this object is valid.Returns a description of usage, or limitations of usage, for which this object is valid.int
Returns a hash code value for this domain.Methods inherited from class FormattableObject
print, toString, toString, toWKT
-
Field Details
-
scope
Description of domain of usage, or limitations of usage, for which the object is valid. This isnull
(i.e. is not replaced by the "not known" text) if the value given to the constructor was null.- See Also:
-
domainOfValidity
Area for which the object is valid. This isnull
(i.e. is not replaced by the "not known" text) if the value given to the constructor was null.- See Also:
-
-
Constructor Details
-
DefaultObjectDomain
Creates a new domain with the given scope and extent. If any value isnull
, 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.domainOfValidity
- area for which the object is valid.
-
-
Method Details
-
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 theNilObject
interface withNilReason.UNKNOWN
.- Returns:
- the domain of usage.
-
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 theNilObject
interface withNilReason.UNKNOWN
.- Returns:
- the area or time frame of usage.
-
equals
Compares the specified object with this object for equality. This method is implemented as below (omitting assertions):return equals(other, ComparisonMode.STRICT);
equals(Object, ComparisonMode)
instead of this method.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classObject
- Parameters:
object
- the other object (may benull
).- Returns:
true
if both objects are equal.- See Also:
-
equals
Compares this object system with the specified object for equality.- Specified by:
equals
in interfaceLenientComparable
- Parameters:
object
- the object to compare tothis
.mode
-STRICT
orIGNORE_METADATA
.- Returns:
true
if both objects are equal.- See Also:
-
hashCode
public int hashCode()Returns a hash code value for this domain. -
formatTo
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:
formatTo
in classFormattableObject
- 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:
-