Class AbstractNode
- java.lang.Object
-
- org.locationtech.jts.index.strtree.AbstractNode
-
- All Implemented Interfaces:
java.io.Serializable,Boundable
public abstract class AbstractNode extends java.lang.Object implements Boundable, java.io.Serializable
A node of anAbstractSTRtree. A node is one of:- empty
- an interior node containing child
AbstractNodes - a leaf node containing data items (
ItemBoundables).
- Version:
- 1.7
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractNode()Default constructor required for serialization.AbstractNode(int level)Constructs an AbstractNode at the given level in the tree
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildBoundable(Boundable childBoundable)Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable)java.lang.ObjectgetBounds()Gets the bounds of this nodejava.util.ListgetChildBoundables()Returns either childAbstractNodes, or if this is a leaf node, real data (wrapped inItemBoundables).intgetLevel()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 levelbooleanisEmpty()Tests whether there are anyBoundables at this node.intsize()Gets the count of theBoundables at this node.
-
-
-
Constructor Detail
-
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 Detail
-
getChildBoundables
public java.util.List getChildBoundables()
Returns either childAbstractNodes, or if this is a leaf node, real data (wrapped inItemBoundables).- Returns:
- a list of the children
-
getBounds
public java.lang.Object 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 theBoundables at this node.- Returns:
- the count of boundables at this node
-
isEmpty
public boolean isEmpty()
Tests whether there are anyBoundables at this node.- Returns:
- true if there are boundables at this node
-
addChildBoundable
public void addChildBoundable(Boundable childBoundable)
Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable)- Parameters:
childBoundable- the child to add
-
-