public interface SpatialUnit extends OsidPrimitive, java.lang.Comparable<SpatialUnit>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SpatialUnit unit)
Compares this spatial unit with the specified
SpatialUnit to determine the natural order. |
boolean |
equals(java.lang.Object obj)
Determines if the given
SpatialUnit is equal to
this one. |
SpatialUnit |
getInnerBound()
Gets the lower bound of the spatial unit.
|
SpatialUnit |
getOuterBound()
Gets the upper bound of the spatial unit.
|
int |
hashCode()
Returns a hash code value for this
SpatialUnit
based on the types, values, granularity, and uncertainties. |
boolean |
isCloser(SpatialUnit one,
SpatialUnit another)
Tests if one SpatialUnit is closer than another to this
SpatialUnit.
|
boolean |
isExclusive(SpatialUnit unit)
Tests if this SpatialUnit, as specified by its uncertainty,
does not overlap the given SpatialUnit.
|
boolean |
isFarther(SpatialUnit one,
SpatialUnit another)
Tests if one SpatialUnit is farther than another from this
SpatialUnit.
|
boolean |
isInclusive(SpatialUnit unit)
Tests if the SpatialUnit, as specified by its uncertainty,
completely includes the given SpatialUnit ranged by its
uncertainty.
|
boolean |
isLarger(SpatialUnit unit)
Tests if this SpatialUnit is greater than the given SpatialUnit.
|
boolean |
isSmaller(SpatialUnit unit)
Tests if this SpatialUnit is less than the given SpatialUnit.
|
toString
boolean isLarger(SpatialUnit unit)
unit
- the spatial unit to comparetrue
if this spatial unit is larger,
false
otherwiseNullArgumentException
- unit
is null
UnsupportedException
- cannot compare spatial unitboolean isSmaller(SpatialUnit unit)
unit
- the spatial unit to comparetrue
if this spatial unit is less,
false
otherwiseNullArgumentException
- unit
is null
UnsupportedException
- cannot compare spatial unitboolean isCloser(SpatialUnit one, SpatialUnit another)
one
- the spatial unit to compareanother
- the spatial unit to comparetrue
if this one
is closer
than another
, false
otherwiseNullArgumentException
- one
or another
is null
UnsupportedException
- cannot compare spatial unitboolean isFarther(SpatialUnit one, SpatialUnit another)
one
- the spatial unit to compareanother
- the spatial unit to comparetrue
if this one
is closer
than another
, false
otherwiseNullArgumentException
- one
or another
is null
UnsupportedException
- cannot compare spatial unitboolean isInclusive(SpatialUnit unit)
unit
- the spatial unit to comparetrue
if this spatial unit includes the given
spatial unit, false
otherwiseNullArgumentException
- unit
is null
UnsupportedException
- cannot compare spatial unitboolean isExclusive(SpatialUnit unit)
unit
- the spatial unit to comparetrue
if this spatial unit is excluded,
false
otherwiseNullArgumentException
- unit
is null
UnsupportedException
- cannot compare spatial unitSpatialUnit getInnerBound()
SpatialUnit getOuterBound()
int compareTo(SpatialUnit unit)
SpatialUnit
to determine the natural order. Returns
a negative integer, zero, or a positive integer as this
spatial unit is less than, equal to, or greater than the specified
SpatialUnit.
The natural ordering is determined first by the natural
ordering of the type, then by its values. This method is not
useful for numeric comparisons. The ranges implied by their
granularities and uncertainties may overlap in such a way that
two unequal SpatialUnits may be neither less than or greater than
the other.
If compareTo
a spatial unit is zero, then
equals()
must be true
and their hash
codes must also be equal for consistent behavior. For
orderings that may yield inconsistent behavior, an external
Comparator
should be used.compareTo
in interface java.lang.Comparable<SpatialUnit>
unit
- the spatial unit to be comparedjava.lang.ClassCastException
- if the specified spatial unit's
type prevents it from being compared to this spatial
unitboolean equals(java.lang.Object obj)
SpatialUnit
is equal to
this one.equals
in class java.lang.Object
obj
- an object to compare true
if the given object is equal to
this Spatial Unit
, false
otherwiseint hashCode()
SpatialUnit
based on the types, values, granularity, and uncertainties.hashCode
in class java.lang.Object