|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.swans.misc.Location
public abstract class Location
Location (of a node).
| Nested Class Summary | |
|---|---|
static class |
Location.Location2D
A planar location implementation. |
static class |
Location.Location3D
A three-dimensional location implementation. |
| Constructor Summary | |
|---|---|
Location()
|
|
| Method Summary | |
|---|---|
abstract void |
add(Location l)
Vector addition of locations... |
abstract float |
distance(Location l)
Compute distance between two locations. |
abstract float |
distanceSqr(Location l)
Compute distance squared between two locations. |
Location |
getClone()
Return clone of location object. |
abstract float |
getHeight()
Return height of location. |
abstract float |
getX()
Return X-coordinate of location. |
abstract float |
getY()
Return Y-coordinate of location. |
abstract boolean |
inside(Location bounds)
Determine whether point is inside bounds. |
abstract boolean |
inside(Location min,
Location max)
Determine whether points is inside bounds. |
static Location |
parse(java.lang.String s)
Parse string into 2d or 3d Location object. |
abstract Location |
step(Location l,
int steps)
Divide (scale) vector from current to second location into a number of equal step (displacement) vectors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Location()
| Method Detail |
|---|
public abstract float getX()
public abstract float getY()
public abstract float getHeight()
public abstract float distance(Location l)
l - second location
public abstract float distanceSqr(Location l)
l - second location
public abstract Location step(Location l,
int steps)
l - destination locationsteps - number of steps to destination
public abstract boolean inside(Location bounds)
bounds - bounds to test again
public abstract boolean inside(Location min,
Location max)
min - lower left boundmax - upper right bound
public abstract void add(Location l)
l - second location / displacementpublic Location getClone()
public static Location parse(java.lang.String s)
s - string to be parsed: format = x,y[,h]
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||