se.liu.ida.critiquer.activities.parameters
Class Location
java.lang.Object
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
Location
public Location(LocationParameter param)
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()