Jadex 0.96

jadex.examples.cleanerworld.single
Class Location

java.lang.Object
  extended by jadex.examples.cleanerworld.single.Location

public class Location
extends Object

The location represents a location on the world map.


Field Summary
static double DEFAULT_TOLERANCE
          Distance, when two locations are considered near.
 double x
          The x coordinate.
 double y
          The y coordinate.
 
Constructor Summary
Location(double x, double y)
          Create a new location.
 
Method Summary
 double getDistance(Location other)
          Caculate is a location is near this location.
 boolean isNear(Location other)
          Check, if two locations are near to each other using the default tolerance.
 boolean isNear(Location other, double tolerance)
          Check, if two locations are near to each other.
 String toString()
          Convert the location to a string representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TOLERANCE

public static final double DEFAULT_TOLERANCE
Distance, when two locations are considered near.

See Also:
Constant Field Values

x

public double x
The x coordinate.


y

public double y
The y coordinate.

Constructor Detail

Location

public Location(double x,
                double y)
Create a new location.

Parameters:
x - The x coordinate.
y - The y coordinate.
Method Detail

getDistance

public double getDistance(Location other)
Caculate is a location is near this location.

Returns:
The distance.

isNear

public boolean isNear(Location other)
Check, if two locations are near to each other using the default tolerance.

Returns:
True, if two locations are near to each other.

isNear

public boolean isNear(Location other,
                      double tolerance)
Check, if two locations are near to each other.

Parameters:
tolerance - The distance, when two locations are considered near.
Returns:
True, if two locations are near to each other.

toString

public String toString()
Convert the location to a string representation.

Overrides:
toString in class Object

Jadex 0.96

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.