JTS Topology Suite version 1.13

com.vividsolutions.jts.index.strtree
Class AbstractNode

java.lang.Object
  extended by com.vividsolutions.jts.index.strtree.AbstractNode
All Implemented Interfaces:
Boundable, java.io.Serializable

public abstract class AbstractNode
extends java.lang.Object
implements Boundable, java.io.Serializable

A node of an AbstractSTRtree. A node is one of:

A node stores the bounds of its children, and its level within the index tree.

Version:
1.7
See Also:
Serialized Form

Constructor Summary
AbstractNode()
          Default constructor required for serialization.
AbstractNode(int level)
          Constructs an AbstractNode at the given level in the tree
 
Method Summary
 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 node
 java.util.List getChildBoundables()
          Returns either child AbstractNodes, or if this is a leaf node, real data (wrapped in ItemBoundables).
 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
 boolean isEmpty()
          Tests whether there are any Boundables at this node.
 int size()
          Gets the count of the Boundables at this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 child AbstractNodes, or if this is a leaf node, real data (wrapped in ItemBoundables).


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

Specified by:
getBounds in interface Boundable
Returns:
the object representing bounds in this index

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 the Boundables at this node.

Returns:
the count of boundables at this node

isEmpty

public boolean isEmpty()
Tests whether there are any Boundables 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)


JTS Topology Suite version 1.13