se.liu.ida.critiquer.activities.parameters
Class Location

java.lang.Object
  extended by se.liu.ida.critiquer.activities.parameters.Location

public class Location
extends Object

A geographical location is modelled using this class. There may be one or more location parameters that have this Location as their value. They are all notified when the location changes value.

Author:
olale

Constructor Summary
Location(LocationParameter param)
           
 
Method Summary
 void addParam(LocationParameter param)
           
 double distanceTo(Location loc)
          Distance in meters between two locations.
 boolean equals(Object obj)
           
 Rectangle getArea()
           
 ArrayList<LocationParameter> getLocationParams()
           
 int hashCode()
          Ensure that locations with the same name have the same hash value.
 void removeParam(LocationParameter param)
           
 void setArea(Rectangle area)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Location

public Location(LocationParameter param)
Method Detail

addParam

public void addParam(LocationParameter param)

removeParam

public void removeParam(LocationParameter param)

getLocationParams

public ArrayList<LocationParameter> getLocationParams()
Returns:
Returns the location parameters that this location is connected to.

distanceTo

public double distanceTo(Location loc)
Distance in meters between two locations. This takes the scale of the geographical view into account.

Parameters:
loc - the location to calculate distance to.
Returns:
a distance in meters

getArea

public Rectangle getArea()
Returns:
Returns the area.

setArea

public void setArea(Rectangle area)
Parameters:
area - The area to set.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Ensure that locations with the same name have the same hash value. This should not really be necessary though, since there should be no need for two different locations with the same name.

Overrides:
hashCode in class Object
See Also:
Object.hashCode()