de.lmu.ifi.dbs.elki.index.tree
Interface Node<E extends Entry>

Type Parameters:
E - the type of Entry used in the index
All Superinterfaces:
Externalizable, Page, Serializable
All Known Subinterfaces:
SpatialNode<N,E>
All Known Implementing Classes:
AbstractMTreeNode, AbstractNode, AbstractRStarTreeNode, DeLiCluNode, MkAppTreeNode, MkCoPTreeNode, MkMaxTreeNode, MkTabTreeNode, MTreeNode, RStarTreeNode

public interface Node<E extends Entry>
extends Page

This interface defines the common requirements of nodes in an index structure. A node has to extend the page interface for persistent storage and has to provide an enumeration over its children.


Method Summary
 int addDirectoryEntry(E entry)
          Adds a new directory entry to this node's children and returns the index of the entry in this node's children array.
 int addLeafEntry(E entry)
          Adds a new leaf entry to this node's children and returns the index of the entry in this node's children array.
 Enumeration<IndexTreePath<E>> children(IndexTreePath<E> parentPath)
          Returns an enumeration of the children paths of this node.
 E getEntry(int index)
          Returns the entry at the specified index.
 int getNumEntries()
          Returns the number of entries of this node.
 boolean isLeaf()
          Returns true if this node is a leaf node, false otherwise.
 
Methods inherited from interface de.lmu.ifi.dbs.elki.persistent.Page
getPageID, isDirty, setDirty, setPageID
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Method Detail

children

Enumeration<IndexTreePath<E>> children(IndexTreePath<E> parentPath)
Returns an enumeration of the children paths of this node.

Parameters:
parentPath - the path to this node
Returns:
an enumeration of the children paths of this node

getNumEntries

int getNumEntries()
Returns the number of entries of this node.

Returns:
the number of entries of this node

isLeaf

boolean isLeaf()
Returns true if this node is a leaf node, false otherwise.

Returns:
true if this node is a leaf node, false otherwise

getEntry

E getEntry(int index)
Returns the entry at the specified index.

Parameters:
index - the index of the entry to be returned
Returns:
the entry at the specified index

addLeafEntry

int addLeafEntry(E entry)
Adds a new leaf entry to this node's children and returns the index of the entry in this node's children array. An UnsupportedOperationException will be thrown if the entry is not a leaf entry or this node is not a leaf node.

Parameters:
entry - the leaf entry to be added
Returns:
the index of the entry in this node's children array
Throws:
UnsupportedOperationException - if entry is not a leaf entry or this node is not a leaf node

addDirectoryEntry

int addDirectoryEntry(E entry)
Adds a new directory entry to this node's children and returns the index of the entry in this node's children array. An UnsupportedOperationException will be thrown if the entry is not a directory entry or this node is not a directory node.

Parameters:
entry - the directory entry to be added
Returns:
the index of the entry in this node's children array
Throws:
UnsupportedOperationException - if entry is not a directory entry or this node is not a directory node

Release 0.4.0 (2011-09-20_1324)