|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.datatypes.Distance
public class Distance
Defines a distance with arbitrary units. Given the constraints of the world, the valid interval is [0,999.99].
| Field Summary | |
|---|---|
private double |
_distance
the distance |
private static double |
DISTANCE_MAX
the maximum distance |
private static double |
DISTANCE_MIN
the minimum distance |
| Constructor Summary | |
|---|---|
Distance()
Creates a distance object with a default value of zero. |
|
Distance(double distance)
Creates a distance object. |
|
Distance(Radius radius)
Creates a distance object. |
|
| Method Summary | |
|---|---|
Distance |
add_(Distance distance)
Adds another unit to this one. |
int |
compareTo(Distance distance)
|
double |
getValue_()
Returns the numerical value of this unit. |
private void |
setValue(double distance)
Sets the distance |
Distance |
subtract_(Distance distance)
Subtract another unit from this one. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private double _distance
private static final double DISTANCE_MAX
private static final double DISTANCE_MIN
| Constructor Detail |
|---|
public Distance()
public Distance(double distance)
distance - - the distancepublic Distance(Radius radius)
radius - - the distance| Method Detail |
|---|
public Distance add_(Distance distance)
add_ in interface I_Unitable<Distance>distance - - the unit
public int compareTo(Distance distance)
compareTo in interface java.lang.Comparable<Distance>public double getValue_()
getValue_ in interface I_Unitable<Distance>private void setValue(double distance)
distance - - the distancepublic Distance subtract_(Distance distance)
subtract_ in interface I_Unitable<Distance>distance - - the unit
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||