public interface Distance extends OsidPrimitive, java.lang.Comparable<Distance>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Distance distance)
Compares this distance with the specified
Distance
to determine the natural order. |
boolean |
equals(java.lang.Object obj)
Determines if the given
Distance is equal to
this one. |
Distance |
getLowerBound()
Gets the lower bound of the distance.
|
Distance |
getUpperBound()
Gets the upper bound of the distance.
|
int |
hashCode()
Returns a hash code value for this
Distance based
on the types, values, granularity and uncertainties. |
boolean |
isContained(Distance distance1,
Distance distance2)
Tests if the range of this Distance, as specified by its
uncertainty, is included within the given two Distances.
|
boolean |
isExclusive(Distance distance)
Tests if the range of this Distance, as specified by its
uncertainty, does not overlap the given Distance.
|
boolean |
isExclusive(Distance distance1,
Distance distance2)
Tests if the range of this Distance, as specified by its
uncertainty, does not overlap with the range of the given two
distances.
|
boolean |
isGreater(Distance distance)
Tests if this Distance is greater than the given Distance.
|
boolean |
isInclusive(Distance distance)
Tests if the range of this Distance, as specified by its
uncertainty, includes the given Distance ranged by its
uncertainty.
|
boolean |
isLess(Distance distance)
Tests if this Distance is less than the given Distance.
|
toStringboolean isGreater(Distance distance)
distance - the distance to comparetrue if this distance is larger,
false otherwiseNullArgumentException - distance
is nullboolean isLess(Distance distance)
distance - the distance to comparetrue if this distance is less,
false otherwiseNullArgumentException - distance
is nullboolean isInclusive(Distance distance)
distance - the distance to comparetrue if this distance includes the given
distance, false otherwiseNullArgumentException - distance
is nullboolean isContained(Distance distance1, Distance distance2)
distance1 - the start distance to comparedistance2 - the end distance to comparetrue if this distance is included,
false otherwiseNullArgumentException - distance1
or distance2 is nullboolean isExclusive(Distance distance)
distance - the distance to comparetrue if this distance is excluded,
false otherwiseNullArgumentException - distance
is nullboolean isExclusive(Distance distance1, Distance distance2)
distance1 - the start distance to comparedistance2 - the end distance to comparetrue if this distance is excluded,
false otherwiseNullArgumentException - distance1
or distance2 is nullDistance getLowerBound()
Distance getUpperBound()
int compareTo(Distance distance)
Distance
to determine the natural order. Returns a negative integer,
zero, or a positive integer as this distance is less than,
equal to, or greater than the specified Distance.
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 Distances may be neither less than or greater than
the other.
If compareTo a distance 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<Distance>distance - the distance to be comparedjava.lang.ClassCastException - if the specified distance's type
prevents it from being compared to this distanceboolean equals(java.lang.Object obj)
Distance is equal to
this one.equals in class java.lang.Objectobj - an object to compare true if the given object is equal to
this DateTime, false
otherwiseint hashCode()
Distance based
on the types, values, granularity and uncertainties.hashCode in class java.lang.Object