|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.harvard.syrah.pyxida.nc.lib.Coordinate
public class Coordinate
A coordinate in the Euclidian space.
Field Summary | |
---|---|
protected static int |
CLASS_HASH
|
protected double[] |
coords
|
static double |
MIN_COORD
|
protected int |
num_dims
|
protected byte |
version
|
Constructor Summary | |
---|---|
protected |
Coordinate(Coordinate c)
|
protected |
Coordinate(double[] init_pos,
boolean make_copy)
Creates a new coordinate having a position specified by the array init_coords . |
|
Coordinate(float[] init_pos)
Creates a new coordinate having a position specified by the array init_coords . |
|
Coordinate(int num_dimensions)
Creates a new coordinate having a position at the origin. |
|
Coordinate(int num_dimensions,
java.io.DataInputStream dis)
|
Method Summary | |
---|---|
void |
add(Vec v)
|
protected boolean |
assign(Coordinate c)
|
Vec |
asVectorFromZero(boolean make_copy)
|
boolean |
atOrigin()
|
void |
bump()
Move a small distance along each dimension from where we are currently. |
void |
checkHeight()
|
double |
distanceTo(Coordinate c)
|
double |
distanceToNonOriginCoord(Coordinate c)
Returns the Euclidian distance to the given coordinate parameter. |
boolean |
equals(java.lang.Object obj)
|
protected Vec |
getDirection(Coordinate c)
|
int |
getNumDimensions()
Returns the number of dimensions this coordinate has. |
byte |
getVersion()
|
int |
hashCode()
|
boolean |
isCompatible(Coordinate _other)
|
boolean |
isValid()
|
Coordinate |
makeCopy()
Creates a copy of this Coordinate object, such that updates
in this coordinate are not reflected in the returned object. |
protected void |
reset()
|
void |
toSerialized(java.io.DataOutputStream dos)
|
java.lang.String |
toString()
|
java.lang.String |
toStringAsVector()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int CLASS_HASH
protected final double[] coords
protected final byte version
protected final int num_dims
public static double MIN_COORD
Constructor Detail |
---|
public Coordinate(int num_dimensions)
num_dimensions
- the number of coordinate dimensionspublic Coordinate(int num_dimensions, java.io.DataInputStream dis) throws java.io.IOException
num_dimensions
- dis
-
java.io.IOException
protected Coordinate(Coordinate c)
protected Coordinate(double[] init_pos, boolean make_copy)
init_coords
. The number of dimensions is this equal to the
array length.
init_pos
- the position for this coordinatemake_copy
- whether a copy of the array should be madepublic Coordinate(float[] init_pos)
init_coords
. The number of dimensions is this equal to the
array length.
init_pos
- the position for this coordinateMethod Detail |
---|
public byte getVersion()
public Coordinate makeCopy()
Coordinate
object, such that updates
in this coordinate are not reflected in the returned object.
public void toSerialized(java.io.DataOutputStream dos) throws java.io.IOException
java.io.IOException
public boolean isCompatible(Coordinate _other)
public void bump()
public int getNumDimensions()
public double distanceToNonOriginCoord(Coordinate c)
c
- the coordinate to find the Euclidian distance to
c
public double distanceTo(Coordinate c)
public void add(Vec v)
protected Vec getDirection(Coordinate c)
protected boolean assign(Coordinate c)
public void checkHeight()
public boolean atOrigin()
public Vec asVectorFromZero(boolean make_copy)
public boolean isValid()
protected void reset()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringAsVector()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |