public interface Speed extends OsidPrimitive, java.lang.Comparable<Speed>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Speed speed)
Compares this Speed with the specified Speed to determine the
natural order.
|
boolean |
equals(java.lang.Object obj)
Determines if the given
Speeds is equal to
this one. |
Speed |
getLowerBound()
Gets the lower bound of the speed.
|
Speed |
getUpperBound()
Gets the upper bound of the speed.
|
int |
hashCode()
Returns a hash code value for this
Speed based
on the distance and time units. |
boolean |
isContained(Speed speed1,
Speed speed2)
Tests if the range of this Speed, as specified by its
uncertainty, is included within the given two Speeds.
|
boolean |
isExclusive(Speed speed)
Tests if the range of this Speed, as specified by its
uncertainty, does not overlap the given Speed.
|
boolean |
isExclusive(Speed speed1,
Speed speed2)
Tests if the range of this Speed, as specified by its
uncertainty, does not overlap with the range of the given two
speeds.
|
boolean |
isGreater(Speed speed)
Tests if this Speed is greater than the given Speed.
|
boolean |
isInclusive(Speed speed)
Tests if the range of this Speed, as specified by its
uncertainty, includes the given Speed ranged by its
uncertainty.
|
boolean |
isLess(Speed speed)
Tests if this Speed is less than the given Speed.
|
toString
boolean isGreater(Speed speed)
speed
- the speed to comparetrue
if this speed is larger,
false
otherwiseNullArgumentException
- speed
is null
UnsupportedException
- cannot compare speedboolean isLess(Speed speed)
speed
- the speed to comparetrue
if this speed is less,
false
otherwiseNullArgumentException
- speed
is null
UnsupportedException
- cannot compare speedboolean isInclusive(Speed speed)
speed
- the speed to comparetrue
if this speed includes the given
speed, false
otherwiseNullArgumentException
- speed
is null
boolean isContained(Speed speed1, Speed speed2)
speed1
- the start speed to comparespeed2
- the end speed to comparetrue
if this speed is included,
false
otherwiseNullArgumentException
- speed1
or speed2
is null
boolean isExclusive(Speed speed)
speed
- the speed to comparetrue
if this speed is excluded,
false
otherwiseNullArgumentException
- speed
is null
boolean isExclusive(Speed speed1, Speed speed2)
speed1
- the start speed to comparespeed2
- the end speed to comparetrue
if this speed is excluded,
false
otherwiseNullArgumentException
- speed1
or speed2
is null
Speed getLowerBound()
Speed getUpperBound()
int compareTo(Speed speed)
compareTo
a speed 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<Speed>
speed
- the speed to be comparedjava.lang.ClassCastException
- if the specified speed's type
prevents it from being compared to this speedboolean equals(java.lang.Object obj)
Speeds
is equal to
this one. Two versions are equal if their distance and
time units are equal.equals
in class java.lang.Object
obj
- an object to compare true
if the given object is equal to
this Speed
, false
otherwiseint hashCode()
Speed
based
on the distance and time units.hashCode
in class java.lang.Object