Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree
Class BreadthFirstEnumeration<O extends DatabaseObject,N extends Node<N,E>,E extends Entry>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.BreadthFirstEnumeration<O,N,E>
All Implemented Interfaces:
Enumeration<TreeIndexPath<E>>

public class BreadthFirstEnumeration<O extends DatabaseObject,N extends Node<N,E>,E extends Entry>
extends Object
implements Enumeration<TreeIndexPath<E>>

Provides a breadth first enumeration over the nodes of an index structure.

Author:
Elke Achtert

Field Summary
 Enumeration<TreeIndexPath<E>> EMPTY_ENUMERATION
          Represents an empty enumeration.
private  TreeIndex<O,N,E> index
          The index storing the nodes.
private  Queue<Enumeration<TreeIndexPath<E>>> queue
          The queue for the enumeration.
 
Constructor Summary
BreadthFirstEnumeration(TreeIndex<O,N,E> index, TreeIndexPath<E> rootPath)
          Creates a new breadth first enumeration with the specified node as root node.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 TreeIndexPath<E> nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ENUMERATION

public final Enumeration<TreeIndexPath<E extends Entry>> EMPTY_ENUMERATION
Represents an empty enumeration.


queue

private Queue<Enumeration<TreeIndexPath<E extends Entry>>> queue
The queue for the enumeration.


index

private TreeIndex<O extends DatabaseObject,N extends Node<N,E>,E extends Entry> index
The index storing the nodes.

Constructor Detail

BreadthFirstEnumeration

public BreadthFirstEnumeration(TreeIndex<O,N,E> index,
                               TreeIndexPath<E> rootPath)
Creates a new breadth first enumeration with the specified node as root node.

Parameters:
rootPath - the root entry of the enumeration
index - the index storing the nodes
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface Enumeration<TreeIndexPath<E extends Entry>>
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

nextElement

public TreeIndexPath<E> nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface Enumeration<TreeIndexPath<E extends Entry>>
Returns:
the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.

Release 0.1 (2008-07-10_1838)