Class AbstractNode<T, TItem>
- Namespace
- NetTopologySuite.Index.Strtree
- Assembly
- NetTopologySuite.dll
A node of an AbstractSTRtree<T, TItem>. A node is one of:
- empty
- an interior node containing child AbstractNode<T, TItem>s
- a leaf node containing data items (ItemBoundable<T, TItem>s).
public abstract class AbstractNode<T, TItem> : IBoundable<T, TItem> where T : IIntersectable<T>, IExpandable<T>
Type Parameters
T
TItem
- Inheritance
-
AbstractNode<T, TItem>
- Implements
-
IBoundable<T, TItem>
- Inherited Members
Constructors
AbstractNode(int)
Constructs an AbstractNode at the given level in the tree
protected AbstractNode(int level)
Parameters
level
int0 if this node is a leaf, 1 if a parent of a leaf, and so on; the root node will have the highest level.
Properties
Bounds
Gets the bounds of this node
public T Bounds { get; }
Property Value
- T
ChildBoundables
Returns either child AbstractNode<T, TItem>s, or if this is a leaf node, real data (wrapped in ItemBoundable<T, TItem>s).
public IList<IBoundable<T, TItem>> ChildBoundables { get; set; }
Property Value
- IList<IBoundable<T, TItem>>
Count
Gets the count of the IBoundable<T, TItem>s at this node.
public int Count { get; }
Property Value
IsEmpty
Tests whether there are any IBoundable<T, TItem>s at this node.
public bool IsEmpty { get; }
Property Value
Item
Gets the item that is bounded
public TItem Item { get; }
Property Value
- TItem
Level
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.
public int Level { get; }
Property Value
Methods
AddChildBoundable(IBoundable<T, TItem>)
Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable).
public void AddChildBoundable(IBoundable<T, TItem> childBoundable)
Parameters
childBoundable
IBoundable<T, TItem>The child to add.
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.
protected abstract T ComputeBounds()
Returns
- T
An Envelope (for STRtrees), an Interval (for SIRtrees), or other object (for other subclasses of AbstractSTRtree).