|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the methods that a class must implement in order to be locatable in a 2-dimensional latitude / longitude world.
Method Summary | |
double |
distanceTo(hw6.Locatable other)
Calculate the distance to another Locatable object |
hw6.Location |
getLocation()
Return a reference to a copy of the Location object describing our current position. |
void |
setLocation(double lat,
double lon)
Set the values of our current Location by copying them from the arguments provided. |
void |
setLocation(hw6.Location loc)
Set the values of our current Location by copying them from the given Location object. |
Method Detail |
public hw6.Location getLocation()
public void setLocation(hw6.Location loc)
loc
- the location to copy frompublic void setLocation(double lat, double lon)
lat
- the new latitude valuelon
- the new longitude valuepublic double distanceTo(hw6.Locatable other)
other
- the other Location
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |