|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.util.MutableInt2D
MutableInt2D is largely a class identical to java.awt.Point, except that it is hash-equivalent to Int2D. It is used internally in SparseGrid2D and Continuous2D to do neighborhood lookups without having to create an Int2D every time (which causes lots of garbage collection).
You use MutableInt2D as a STORED hash key at your peril: it has the same misfeature as Point, and you should read the warning in Int2D. However, you can look up Int2D-keyed objects in a hash table by passing in a MutableInt2D instead.
Field Summary | |
int |
x
|
int |
y
|
Constructor Summary | |
MutableInt2D()
|
|
MutableInt2D(Int2D p)
|
|
MutableInt2D(int x,
int y)
|
|
MutableInt2D(java.awt.Point p)
|
Method Summary | |
java.lang.Object |
clone()
|
double |
distance(Double2D p)
Returns the distance FROM this MutableInt2D TO the specified point. |
double |
distance(double x,
double y)
Returns the distance FROM this MutableInt2D TO the specified point |
double |
distance(Int2D p)
Returns the distance FROM this MutableInt2D TO the specified point. |
double |
distance(MutableInt2D p)
Returns the distance FROM this MutableInt2D TO the specified point. |
double |
distance(java.awt.geom.Point2D p)
Returns the distance FROM this MutableInt2D TO the specified point. |
double |
distanceSq(Double2D p)
Returns the squared distance FROM this MutableInt2D TO the specified point. |
double |
distanceSq(double x,
double y)
Returns the squared distance FROM this MutableInt2D TO the specified point |
double |
distanceSq(Int2D p)
Returns the squared distance FROM this MutableInt2D TO the specified point. |
double |
distanceSq(MutableInt2D p)
Returns the squared distance FROM this MutableInt2D TO the specified point. |
double |
distanceSq(java.awt.geom.Point2D p)
Returns the squared distance FROM this MutableInt2D TO the specified point |
boolean |
equals(java.lang.Object obj)
|
int |
getX()
|
int |
getY()
|
int |
hashCode()
|
long |
manhattanDistance(Int2D p)
Returns the manhattan distance FROM this MutableInt2D TO the specified point. |
long |
manhattanDistance(int x,
int y)
Returns the manhattan distance FROM this MutableInt2D TO the specified point. |
long |
manhattanDistance(MutableInt2D p)
Returns the manhattan distance FROM this MutableInt2D TO the specified point. |
void |
setLocation(Int2D p)
Deprecated. use setTo |
void |
setLocation(int x,
int y)
Deprecated. use setTo |
void |
setLocation(MutableInt2D p)
Deprecated. use setTo |
void |
setLocation(java.awt.Point p)
Deprecated. use setTo |
void |
setTo(Int2D p)
|
void |
setTo(int x,
int y)
|
void |
setTo(MutableInt2D p)
|
void |
setTo(java.awt.Point p)
|
void |
setX(int val)
|
void |
setY(int val)
|
java.lang.String |
toCoordinates()
|
java.awt.Point |
toPoint()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int x
public int y
Constructor Detail |
public MutableInt2D()
public MutableInt2D(java.awt.Point p)
public MutableInt2D(Int2D p)
public MutableInt2D(int x, int y)
Method Detail |
public final int getX()
public final int getY()
public final void setX(int val)
public final void setY(int val)
public void setTo(int x, int y)
public void setTo(java.awt.Point p)
public void setTo(Int2D p)
public void setTo(MutableInt2D p)
public void setLocation(int x, int y)
public void setLocation(java.awt.Point p)
public void setLocation(Int2D p)
public void setLocation(MutableInt2D p)
public java.awt.Point toPoint()
public java.lang.String toString()
public java.lang.String toCoordinates()
public java.lang.Object clone()
public final int hashCode()
public final boolean equals(java.lang.Object obj)
public double distance(double x, double y)
public double distance(Double2D p)
public double distance(MutableInt2D p)
public double distance(Int2D p)
public double distance(java.awt.geom.Point2D p)
public double distanceSq(double x, double y)
public double distanceSq(Double2D p)
public double distanceSq(java.awt.geom.Point2D p)
public double distanceSq(MutableInt2D p)
public double distanceSq(Int2D p)
public long manhattanDistance(int x, int y)
public long manhattanDistance(MutableInt2D p)
public long manhattanDistance(Int2D p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |