|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.geo.Distance
public final class Distance
This class represents a geographic distance -- ie. a distance from or to a given geographic position.
Field Summary | |
---|---|
static Distance |
ZERO
A distance equal to zero. |
Constructor Summary | |
---|---|
Distance(double metres)
Create a Distance from a value given in metres. |
Method Summary | |
---|---|
Distance |
add(Distance d)
Return the sum of this and another Distance. |
java.lang.String |
describeNautical()
Convert this distance into a descriptive string, using nautical measures. |
java.lang.String |
formatM()
Format this position for user display in metres. |
java.lang.String |
formatNm()
Format this position for user display in nautical miles. |
static Distance |
fromFeet(double feet)
Create a Distance from a distance given in feet. |
static Distance |
fromNm(double nmiles)
Create a Distance from a distance given in nautical miles. |
double |
getFeet()
Get the distance in feet. |
double |
getMetres()
Get the distance in metres. |
double |
getNm()
Get the distance in nautical miles. |
java.lang.String |
toString()
Format this position as a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Distance ZERO
Constructor Detail |
---|
public Distance(double metres)
metres
- Source distance in metres.Method Detail |
---|
public static Distance fromFeet(double feet)
feet
- Source distance in feet.
public static Distance fromNm(double nmiles)
nmiles
- Source distance in nautical miles.
public final double getMetres()
public final double getFeet()
public final double getNm()
public Distance add(Distance d)
d
- Distance to add to this one.
public java.lang.String formatM()
public java.lang.String formatNm()
public java.lang.String describeNautical()
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 |