|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Landmark
This class implements Locations with names.
Constructor Summary | |
Landmark(java.lang.String tag,
double lat,
double lon)
Create a new Landmark object with the given name located at the given location. |
Method Summary | |
double |
distanceTo(Locatable other)
Calculate the distance to another Locatable object |
Location |
getLocation()
Return a reference to a copy of the Location object describing our position. |
java.lang.String |
getName()
Return the name of this Landmark. |
void |
setLocation(double lat,
double lon)
Set the values of our current Location by copying them from the arguments provided. |
void |
setLocation(Location loc)
Set the values of our current Location by copying them from the given Location object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Landmark(java.lang.String tag, double lat, double lon)
tag
- the Landmark's namelat
- the latitude where this Landmark is located. Must
satisfy the constraints defined by the Location class.lon
- the longitude where this Landmark is located. Must
satisfy the constraints defined by the Location class.Method Detail |
public Location getLocation()
getLocation
in interface Locatable
public void setLocation(Location loc)
setLocation
in interface Locatable
loc
- the Location to copy frompublic void setLocation(double lat, double lon)
setLocation
in interface Locatable
lat
- the new latitude valuelon
- the new longitude valuepublic double distanceTo(Locatable other)
distanceTo
in interface Locatable
other
- the other Location
public java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |