Package com.google.common.collect
Class TreeTraverser.BreadthFirstIterator
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<T>
-
- com.google.common.collect.TreeTraverser.BreadthFirstIterator
-
- All Implemented Interfaces:
PeekingIterator<T>,java.util.Iterator<T>
- Enclosing class:
- TreeTraverser<T>
private final class TreeTraverser.BreadthFirstIterator extends UnmodifiableIterator<T> implements PeekingIterator<T>
-
-
Constructor Summary
Constructors Constructor Description BreadthFirstIterator(T root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tnext()Tpeek()Returns the next element in the iteration, without advancing the iteration.-
Methods inherited from class com.google.common.collect.UnmodifiableIterator
remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.common.collect.PeekingIterator
remove
-
-
-
-
Field Detail
-
queue
private final java.util.Queue<T> queue
-
-
Constructor Detail
-
BreadthFirstIterator
BreadthFirstIterator(T root)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<T>
-
peek
public T peek()
Description copied from interface:PeekingIteratorReturns the next element in the iteration, without advancing the iteration.Calls to
peek()should not change the state of the iteration, except that it may prevent removal of the most recent element viaPeekingIterator.remove().- Specified by:
peekin interfacePeekingIterator<T>
-
next
public T next()
Description copied from interface:PeekingIteratorThe objects returned by consecutive calls to
PeekingIterator.peek()thenPeekingIterator.next()are guaranteed to be equal to each other.- Specified by:
nextin interfacejava.util.Iterator<T>- Specified by:
nextin interfacePeekingIterator<T>
-
-