public final class Location
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Location(int x,
int y) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
int |
distance(Location l)
calculates the Manhattan distance between two points
|
int |
distanceChebyshev(Location l)
returns the chessboard king (or Chebyshev) distance between two locations : max( |this.x - l.x| , |this.y - l.y|)
|
double |
distanceEuclidean(Location l)
calculates the Euclidean distance between two points
|
int |
distanceManhattan(Location l)
calculates the Manhattan distance between two points
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isInArea(Area a) |
boolean |
isInArea(Location tl,
Location br) |
boolean |
isNeigbour(Location l) |
int |
maxBorder(Location l)
Deprecated.
renamed to distanceChessboard
|
java.lang.String |
toString() |
public int distanceManhattan(Location l)
public int distance(Location l)
public double distanceEuclidean(Location l)
public int distanceChebyshev(Location l)
public int maxBorder(Location l)
public boolean isInArea(Area a)
public boolean isNeigbour(Location l)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object