|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.Position
main.City
public class City
The City
class represents coordinates given in
latitude/longitude pairs and the name associated with them.
Field Summary | |
---|---|
private java.lang.String |
cityName
|
Constructor Summary | |
---|---|
City(java.lang.Double latitude,
java.lang.Double longitude,
java.lang.String cityName)
Constructs a new City with the position and name indicated
by the arguments. |
|
City(Position cityPos,
java.lang.String cityName)
Constructs a new City with the position and name indicated
by the arguments. |
Method Summary | |
---|---|
boolean |
equals(City other)
is other object equal to this one? |
java.lang.String |
getCityName()
Returns the city name. |
void |
setCityName(java.lang.String cityName)
Sets the city name |
java.lang.String |
toString()
Returns a string representation of this City . |
Methods inherited from class main.Position |
---|
coordinateDistanceTo, distanceTo, equals, getLatitude, getLongitude, isDefined, setLatitude, setLongitude |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String cityName
Constructor Detail |
---|
public City(java.lang.Double latitude, java.lang.Double longitude, java.lang.String cityName)
City
with the position and name indicated
by the arguments.
latitude
- a Double
longitude
- a Double
cityName
- a String
public City(Position cityPos, java.lang.String cityName)
City
with the position and name indicated
by the arguments.
cityPos
- a Position
cityName
- a String
Method Detail |
---|
public void setCityName(java.lang.String cityName)
cityName
- a String
public java.lang.String getCityName()
public java.lang.String toString()
City
. This is for
debugging purposes only.
toString
in class Position
City
public boolean equals(City other)
other
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |