|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.util.MutableInt3D
public final class MutableInt3D
MutableInt3D stores three values (x, y, and z) and is hash-equivalent to Int3D; except MutableInt3D's values can be modified and Int3D's values cannot. It is used internally in SparseGrid3D and Continuous3D to do neighborhood lookups without having to create an Int3D every time (which causes lots of garbage collection).
You use MutableInt3D as a STORED hash key at your peril: it has the same misfeature as Point, and you should read the warning in Int3D. However, you can look up Int3D-keyed objects in a hash table by passing in a MutableInt3D instead.
Field Summary | |
---|---|
int |
x
|
int |
y
|
int |
z
|
Constructor Summary | |
---|---|
MutableInt3D()
|
|
MutableInt3D(Int2D p)
Explicitly assumes the z value is set to 0 |
|
MutableInt3D(Int2D p,
int z)
|
|
MutableInt3D(Int3D p)
|
|
MutableInt3D(int x,
int y,
int z)
|
|
MutableInt3D(MutableInt2D p)
|
|
MutableInt3D(MutableInt2D p,
int z)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
|
double |
distance(Double3D p)
Returns the distance FROM this Int3D TO the specified point. |
double |
distance(double x,
double y,
double z)
Returns the distance FROM this Int3D TO the specified point |
double |
distance(Int3D p)
Returns the distance FROM this Int3D TO the specified point. |
double |
distance(MutableInt3D p)
Returns the distance FROM this Int3D TO the specified point. |
double |
distanceSq(Double3D p)
Returns the squared distance FROM this Int3D TO the specified point. |
double |
distanceSq(double x,
double y,
double z)
Returns the squared distance FROM this Int3D TO the specified point |
double |
distanceSq(Int3D p)
Returns the squared distance FROM this Int3D TO the specified point. |
double |
distanceSq(MutableInt3D p)
Returns the squared distance FROM this Int3D TO the specified point. |
boolean |
equals(java.lang.Object obj)
|
int |
getX()
|
int |
getY()
|
int |
getZ()
|
int |
hashCode()
|
long |
manhattanDistance(Int3D p)
Returns the manhattan distance FROM this Int3D TO the specified point. |
long |
manhattanDistance(int x,
int y,
int z)
Returns the manhattan distance FROM this Int3D TO the specified point. |
long |
manhattanDistance(MutableInt3D p)
Returns the manhattan distance FROM this Int3D TO the specified point. |
void |
setLocation(Int3D p)
Deprecated. use setTo |
void |
setLocation(int x,
int y,
int z)
Deprecated. use setTo |
void |
setLocation(MutableInt3D p)
Deprecated. use setTo |
void |
setTo(Int3D p)
|
void |
setTo(int x,
int y,
int z)
|
void |
setTo(MutableInt3D p)
|
void |
setX(int val)
|
void |
setY(int val)
|
void |
setZ(int val)
|
java.lang.String |
toCoordinates()
|
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
public int z
Constructor Detail |
---|
public MutableInt3D()
public MutableInt3D(int x, int y, int z)
public MutableInt3D(Int2D p)
public MutableInt3D(Int2D p, int z)
public MutableInt3D(Int3D p)
public MutableInt3D(MutableInt2D p)
public MutableInt3D(MutableInt2D p, int z)
Method Detail |
---|
public final int getX()
public final int getY()
public final int getZ()
public final void setX(int val)
public final void setY(int val)
public final void setZ(int val)
public void setTo(int x, int y, int z)
public void setTo(Int3D p)
public void setTo(MutableInt3D p)
public void setLocation(int x, int y, int z)
public void setLocation(Int3D p)
public void setLocation(MutableInt3D p)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCoordinates()
public java.lang.Object clone()
clone
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public double distance(double x, double y, double z)
public double distance(Double3D p)
public double distance(MutableInt3D p)
public double distance(Int3D p)
public double distanceSq(double x, double y, double z)
public double distanceSq(Double3D p)
public double distanceSq(MutableInt3D p)
public double distanceSq(Int3D p)
public long manhattanDistance(int x, int y, int z)
public long manhattanDistance(MutableInt3D p)
public long manhattanDistance(Int3D p)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |