Class AbstractNode
- java.lang.Object
-
- org.locationtech.jts.index.strtree.AbstractNode
-
- All Implemented Interfaces:
java.io.Serializable
,Boundable
- Direct Known Subclasses:
STRtree.STRtreeNode
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
AbstractNode
s - a leaf node containing data items (
ItemBoundable
s).
- Version:
- 1.7
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
bounds
private java.util.ArrayList
childBoundables
private int
level
private static long
serialVersionUID
-
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 Abstract Methods Concrete Methods Modifier and Type Method Description void
addChildBoundable(Boundable childBoundable)
Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable)protected abstract java.lang.Object
computeBounds()
Returns a representation of space that encloses this Boundable, preferably not much bigger than this Boundable's boundary yet fast to test for intersection with the bounds of other Boundables.java.lang.Object
getBounds()
Gets the bounds of this nodejava.util.List
getChildBoundables()
Returns 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.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
childBoundables
private java.util.ArrayList childBoundables
-
bounds
private java.lang.Object bounds
-
level
private int level
-
-
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 childAbstractNode
s, or if this is a leaf node, real data (wrapped inItemBoundable
s).
-
computeBounds
protected abstract java.lang.Object computeBounds()
Returns a representation of space that encloses this Boundable, preferably not much bigger than this Boundable's boundary yet fast to test for intersection with the bounds of other Boundables. The class of object returned depends on the subclass of AbstractSTRtree.- Returns:
- an Envelope (for STRtrees), an Interval (for SIRtrees), or other object (for other subclasses of AbstractSTRtree)
- See Also:
AbstractSTRtree.IntersectsOp
-
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
-
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
public void addChildBoundable(Boundable childBoundable)
Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable)
-
-