|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jasi.sim.basic.value.AbstractSimValueType jasi.sim.basic.value.AbstractComparableObject<T> jasi.sim.geo.ComparableGeoObject<Speed> jasi.sim.geo.cartesian.Speed
public final class Speed
Immutable class to represent speed values.
Field Summary | |
---|---|
static java.util.Comparator<Speed> |
COMPARATOR
Compare the values of speed objects. |
static Speed |
FIXED
Non-moving, fixed. |
static Speed |
KM_H
Speed constant for a kilometer per hour. |
static Speed |
KM_S
Speed constant for a kilometer per second. |
static Speed |
M_S
Speed constant for meter per second. |
Fields inherited from interface jasi.sim.geo.Geometric |
---|
BEGIN, END, MIDLE |
Constructor Summary | |
---|---|
Speed(Speed s)
Constructor of a speed value. |
|
Speed(java.lang.String s)
Constructor of a speed value. |
Method Summary | |
---|---|
Speed |
add(Speed s)
Add that speed to this speed. |
double |
amount(Speed s)
Retrieve the amount of this speed value in units of that speed. |
int |
compareTo(Speed s)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one. |
int |
hashCode()
Returns a hash code value for the object. |
Speed |
minus(Speed s)
Subtract that speed from this speed. |
Space |
spaceFor(Time t)
Returns the distance moved by this speed in a given time. |
Time |
timeFor(Space d)
Returns the time needed to move a given distance by this speed. |
Speed |
times(double f)
Multiply this Speed object by a factor. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class jasi.sim.basic.value.AbstractComparableObject |
---|
isEQ, isGE, isGT, isLE, isLT, isNE |
Methods inherited from class jasi.sim.basic.value.AbstractSimValueType |
---|
getContent |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jasi.sim.basic.value.SimValue |
---|
getContent |
Field Detail |
---|
public static final java.util.Comparator<Speed> COMPARATOR
public static final Speed M_S
public static final Speed KM_S
public static final Speed KM_H
public static final Speed FIXED
Constructor Detail |
---|
public Speed(Speed s)
s
- A speed value.public Speed(java.lang.String s)
s
- The string representation of a speed value.Method Detail |
---|
public double amount(Speed s)
s
- That speed object.
public Speed add(Speed s)
s
- That speed.
public Speed minus(Speed s)
s
- That speed.
public Speed times(double f)
f
- The multiplication factor.
public Time timeFor(Space d)
d
- That distance.
public Space spaceFor(Time t)
t
- That time.
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- That object which is compared with this object.
public int compareTo(Speed s)
compareTo
in interface java.lang.Comparable<Speed>
compareTo
in class AbstractComparableObject<Speed>
s
- The speed to be compared.
Comparable.compareTo(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |