Package elki.index.tree
Class BreadthFirstEnumeration<N extends Node<E>,E>
- java.lang.Object
-
- elki.index.tree.BreadthFirstEnumeration<N,E>
-
- Type Parameters:
N
- the type of Node used in the indexE
- the type of Entry used in the index
- All Implemented Interfaces:
java.util.Iterator<IndexTreePath<E>>
public class BreadthFirstEnumeration<N extends Node<E>,E> extends java.lang.Object implements java.util.Iterator<IndexTreePath<E>>
Breadth first enumeration over the nodes of an index structure.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Iterator<IndexTreePath<E>>
EMPTY_ENUMERATION
Represents an empty enumeration.private IndexTree<N,E>
index
The index storing the nodes.private java.util.Queue<java.util.Iterator<IndexTreePath<E>>>
queue
The queue for the enumeration.
-
Constructor Summary
Constructors Constructor Description BreadthFirstEnumeration(IndexTree<N,E> index, IndexTreePath<E> rootPath)
Creates a new breadth first enumeration with the specified node as root node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Tests if this enumeration contains more elements.IndexTreePath<E>
next()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
-
-
-
Field Detail
-
EMPTY_ENUMERATION
public final java.util.Iterator<IndexTreePath<E>> EMPTY_ENUMERATION
Represents an empty enumeration.
-
queue
private java.util.Queue<java.util.Iterator<IndexTreePath<E>>> queue
The queue for the enumeration.
-
-
Constructor Detail
-
BreadthFirstEnumeration
public BreadthFirstEnumeration(IndexTree<N,E> index, IndexTreePath<E> rootPath)
Creates a new breadth first enumeration with the specified node as root node.- Parameters:
index
- the index tree storing the nodesrootPath
- the root entry of the enumeration
-
-
Method Detail
-
hasNext
public boolean hasNext()
Tests if this enumeration contains more elements.
-
next
public IndexTreePath<E> next()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
-
-