Class KdNode
- java.lang.Object
-
- org.locationtech.jts.index.kdtree.KdNode
-
public class KdNode extends java.lang.Object
A node of aKdTree
, which represents one or more points in the same location.
-
-
Constructor Summary
Constructors Constructor Description KdNode(double _x, double _y, java.lang.Object data)
Creates a new KdNode.KdNode(Coordinate p, java.lang.Object data)
Creates a new KdNode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Coordinate
getCoordinate()
Returns the location of this nodeint
getCount()
Returns the number of inserted points that are coincident at this location.java.lang.Object
getData()
Gets the user data object associated with this node.KdNode
getLeft()
Returns the left node of the treeKdNode
getRight()
Returns the right node of the treedouble
getX()
Returns the X coordinate of the nodedouble
getY()
Returns the Y coordinate of the node(package private) void
increment()
boolean
isRepeated()
Tests whether more than one point with this value have been inserted (up to the tolerance)(package private) void
setLeft(KdNode _left)
(package private) void
setRight(KdNode _right)
-
-
-
Field Detail
-
p
private Coordinate p
-
data
private java.lang.Object data
-
left
private KdNode left
-
right
private KdNode right
-
count
private int count
-
-
Constructor Detail
-
KdNode
public KdNode(double _x, double _y, java.lang.Object data)
Creates a new KdNode.- Parameters:
_x
- coordinate of point_y
- coordinate of pointdata
- a data objects to associate with this node
-
KdNode
public KdNode(Coordinate p, java.lang.Object data)
Creates a new KdNode.- Parameters:
p
- point location of new nodedata
- a data objects to associate with this node
-
-
Method Detail
-
getX
public double getX()
Returns the X coordinate of the node- Returns:
- X coordinate of the node
-
getY
public double getY()
Returns the Y coordinate of the node- Returns:
- Y coordinate of the node
-
getCoordinate
public Coordinate getCoordinate()
Returns the location of this node- Returns:
- p location of this node
-
getData
public java.lang.Object getData()
Gets the user data object associated with this node.- Returns:
-
getLeft
public KdNode getLeft()
Returns the left node of the tree- Returns:
- left node
-
getRight
public KdNode getRight()
Returns the right node of the tree- Returns:
- right node
-
increment
void increment()
-
getCount
public int getCount()
Returns the number of inserted points that are coincident at this location.- Returns:
- number of inserted points that this node represents
-
isRepeated
public boolean isRepeated()
Tests whether more than one point with this value have been inserted (up to the tolerance)- Returns:
- true if more than one point have been inserted with this value
-
setLeft
void setLeft(KdNode _left)
-
setRight
void setRight(KdNode _right)
-
-