|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.utils.math.vertexSpace.vertex2Dspace.Vertex2DSpaceSquare
public class Vertex2DSpaceSquare
This represent one cube of the VertexSpace. It may contain more then one vertex and is responsible for raising the errors if three vertices which are too close are inserted. It goes like this: 1) first vertex creates an epsilon surrounding, other vertices in those surrounding is reported as the first one 2) note that distance of 2 points may be 1.5 epsilon and the third one may lie in both surroundings - that's the time when error is reported Also - those cubes will be stored in HashMap for quick search. So we will need a hash and equal function. equals() is considering precision, size, x, y, z, NOT STORED VERTICES! Use add(Tuple2D) to insert and obtain a Vertex.
Field Summary | |
---|---|
protected int |
hashCode
|
protected double |
precision
|
protected int |
precisionInt
|
protected java.util.HashSet |
vertices
|
protected double[] |
x
X-Extends of the space cube. x[0] < x[1] |
protected double[] |
y
Y-Extends of the space cube. y[0] < y[1] |
Constructor Summary | |
---|---|
Vertex2DSpaceSquare(double[] xy,
double iSize,
int iPrecisionInt)
|
|
Vertex2DSpaceSquare(double iX,
double iY,
double iSize,
int iPrecisionInt)
|
Method Summary | |
---|---|
Vertex2D |
addReferenceUnsafe(Vertex2D v)
|
boolean |
equals(java.lang.Object obj)
|
static int |
getHash(double x,
double y,
double size,
int precisionInt)
Returns hash code for the cube which starts at x, y, z with a certain precision. |
int |
hashCode()
|
java.util.ArrayList |
check(Tuple2D tuple)
Returns list of vertices in whose surroundings tuple lies. |
void |
remove(Vertex2D v)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[] x
protected double[] y
protected int precisionInt
protected double precision
protected final int hashCode
protected java.util.HashSet vertices
Constructor Detail |
---|
public Vertex2DSpaceSquare(double iX, double iY, double iSize, int iPrecisionInt)
public Vertex2DSpaceSquare(double[] xy, double iSize, int iPrecisionInt)
Method Detail |
---|
public static int getHash(double x, double y, double size, int precisionInt)
x
- y
- precisionInt
- public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.ArrayList check(Tuple2D tuple)
tuple
-
public void remove(Vertex2D v)
public Vertex2D addReferenceUnsafe(Vertex2D v)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |