Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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

public interface Node<N extends Node<N,E>,E extends Entry>
extends Page<N>

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.

Author:
Elke Achtert

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<TreeIndexPath<E>> children(TreeIndexPath<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
getID, isDirty, setDirty, setFile, setID
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Method Detail

children

Enumeration<TreeIndexPath<E>> children(TreeIndexPath<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.2.1 (2009-07-13_1605)