main
Class City

java.lang.Object
  extended by main.Position
      extended by main.City
Direct Known Subclasses:
ImageMapCity

public class City
extends Position

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

cityName

private java.lang.String cityName
Constructor Detail

City

public 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.

Parameters:
latitude - a Double
longitude - a Double
cityName - a String

City

public City(Position cityPos,
            java.lang.String cityName)
Constructs a new City with the position and name indicated by the arguments.

Parameters:
cityPos - a Position
cityName - a String
Method Detail

setCityName

public void setCityName(java.lang.String cityName)
Sets the city name

Parameters:
cityName - a String

getCityName

public java.lang.String getCityName()
Returns the city name.

Returns:
the city name

toString

public java.lang.String toString()
Returns a string representation of this City. This is for debugging purposes only.

Overrides:
toString in class Position
Returns:
a string representation of this City

equals

public boolean equals(City other)
is other object equal to this one?

Parameters:
other -
Returns:
true if they are equal