Interface Node<E>

  • Type Parameters:
    E - the type of Entry used in the index
    All Superinterfaces:
    elki.persistent.Page
    All Known Implementing Classes:
    AbstractNode

    public interface Node<E>
    extends elki.persistent.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.
    Since:
    0.1
    Author:
    Elke Achtert
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int addEntry​(E entry)
      Adds a new entry to this node's children and returns the index of the entry in the children array.
      java.util.Iterator<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 elki.persistent.Page

        getPageID, isDirty, setDirty, setPageID
    • Method Detail

      • children

        java.util.Iterator<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
      • addEntry

        int addEntry​(E entry)
        Adds a new entry to this node's children and returns the index of the entry in the children array. An IllegalStateException will be thrown when inserting leaf entries into directory nodes or conversely.
        Parameters:
        entry - the entry to be added
        Returns:
        the index of the entry in this node's children array
        Throws:
        java.lang.IllegalStateException - when inserting leaf entries into non-leaf nodes or conversely