Class AbstractNode
java.lang.Object
org.locationtech.jts.index.strtree.AbstractNode
- All Implemented Interfaces:
Serializable
,Boundable
A node of an
AbstractSTRtree
. A node is one of:
- empty
- an interior node containing child
AbstractNode
s - a leaf node containing data items (
ItemBoundable
s).
- Version:
- 1.7
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor required for serialization.AbstractNode
(int level) Constructs an AbstractNode at the given level in the tree -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildBoundable
(Boundable childBoundable) Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable)Gets the bounds of this nodeReturns either childAbstractNode
s, or if this is a leaf node, real data (wrapped inItemBoundable
s).int
getLevel()
Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the root node will have the highest levelboolean
isEmpty()
Tests whether there are anyBoundable
s at this node.int
size()
Gets the count of theBoundable
s at this node.
-
Constructor Details
-
AbstractNode
public AbstractNode()Default constructor required for serialization. -
AbstractNode
public AbstractNode(int level) Constructs an AbstractNode at the given level in the tree- Parameters:
level
- 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the root node will have the highest level
-
-
Method Details
-
getChildBoundables
Returns either childAbstractNode
s, or if this is a leaf node, real data (wrapped inItemBoundable
s).- Returns:
- a list of the children
-
getBounds
Gets the bounds of this node -
getLevel
public int getLevel()Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the root node will have the highest level- Returns:
- the node level
-
size
public int size()Gets the count of theBoundable
s at this node.- Returns:
- the count of boundables at this node
-
isEmpty
public boolean isEmpty()Tests whether there are anyBoundable
s at this node.- Returns:
- true if there are boundables at this node
-
addChildBoundable
Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable)- Parameters:
childBoundable
- the child to add
-