Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities
Class BreadthFirstEnumeration<E extends Enumeratable<E>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.BreadthFirstEnumeration<E>
All Implemented Interfaces:
Enumeration<E>

public class BreadthFirstEnumeration<E extends Enumeratable<E>>
extends Object
implements Enumeration<E>

Provides a breadth first enumeration over enumeratable objects.

Author:
Elke Achtert

Field Summary
 Enumeration<E> EMPTY_ENUMERATION
          Represents an empty enumeration.
private  Queue<E> queue
          The queue for the enumeration.
 
Constructor Summary
BreadthFirstEnumeration(E root)
          Creates a new breadth first enumeration with the specified node as root node.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 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<E extends Enumeratable<E>> EMPTY_ENUMERATION
Represents an empty enumeration.


queue

private Queue<E extends Enumeratable<E>> queue
The queue for the enumeration.

Constructor Detail

BreadthFirstEnumeration

public BreadthFirstEnumeration(E root)
Creates a new breadth first enumeration with the specified node as root node.

Parameters:
root - the root of the enumeration
Method Detail

hasMoreElements

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

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

nextElement

public 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<E extends Enumeratable<E>>
Returns:
the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.

Release 0.1 (2008-07-10_1838)