|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjasi.sim.basic.value.AbstractSimValueType
jasi.sim.basic.value.AbstractComparableObject<T>
jasi.sim.geo.ComparableGeoObject<Space>
jasi.sim.geo.cartesian.Space
public final class Space
Immutable class to represent space values.
| Nested Class Summary | |
|---|---|
static class |
Space.Distance
Distance function, which imposes a total ordering by comparing the distance to a center. |
| Field Summary | |
|---|---|
static java.util.Comparator<Space> |
COMPARATOR
The space value comparator, which imposes a total ordering. |
static Space |
DELTA
The epsilon constant for equal spaces. |
static Space |
KM
Space constant for a kilometer. |
static Space |
M
Space constant for a meter. |
static Space |
MM
Space constant for a millimeter. |
static Space |
ORIGIN
The center of the space values. |
| Fields inherited from interface jasi.sim.geo.Geometric |
|---|
BEGIN, END, MIDLE |
| Constructor Summary | |
|---|---|
Space(Space s)
Constructor of a space value. |
|
Space(java.lang.String s)
Constructor of a space value. |
|
| Method Summary | |
|---|---|
Space |
add(Space s)
Add that space value to this space value. |
double |
amount(Space s)
Retrieve the amount of this space value in units of that space value. |
int |
compareTo(Space s)
Compares this object with the specified object for order. |
Speed |
divide(Time t)
Returns the speed for moving this space in a given time. |
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. |
Space |
minus(Space s)
Subtract that space value from this space value. |
Time |
timeFor(Speed v)
Returns the time needed to move this distance ba a given speed. |
Space |
times(double f)
Multiply this space value 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<Space> COMPARATOR
public static final Space M
public static final Space MM
public static final Space KM
public static final Space ORIGIN
public static final Space DELTA
| Constructor Detail |
|---|
public Space(Space s)
s - A space value.public Space(java.lang.String s)
s - The string representation of a space value.| Method Detail |
|---|
public double amount(Space s)
s - That space value.
public Space add(Space s)
s - That space value.
public Space minus(Space s)
s - That space value.
public Space times(double f)
f - The multiplication factor.
public java.lang.String toString()
toString in class java.lang.Objectpublic Time timeFor(Speed v)
v - That speed.
public Speed divide(Time t)
t - That time.
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - That object which is compared with this object.
public int compareTo(Space s)
compareTo in interface java.lang.Comparable<Space>compareTo in class AbstractComparableObject<Space>s - The space to be compared.
Comparable.compareTo(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||