|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.collect.ForwardingObject com.google.common.collect.ForwardingIterator<T>
public abstract class ForwardingIterator<T>
An iterator which forwards all its method calls to another iterator. Subclasses should override one or more methods to modify the behavior of the backing iterator as desired per the decorator pattern.
Constructor Summary | |
---|---|
protected |
ForwardingIterator()
Constructor for use by subclasses. |
Method Summary | |
---|---|
protected abstract Iterator<T> |
delegate()
Returns the backing delegate instance that methods are forwarded to. |
boolean |
hasNext()
Returns true if the iteration has more elements. |
T |
next()
Returns the next element in the iteration. |
void |
remove()
Removes from the underlying collection the last element returned by this iterator (optional operation). |
Methods inherited from class com.google.common.collect.ForwardingObject |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ForwardingIterator()
Method Detail |
---|
protected abstract Iterator<T> delegate()
ForwardingObject
ForwardingSet.delegate()
. Concrete subclasses override this method to supply
the instance being decorated.
delegate
in class ForwardingObject
public boolean hasNext()
java.util.Iterator
true
if the iteration has more elements.
(In other words, returns true
if Iterator.next()
would
return an element rather than throwing an exception.)
hasNext
in interface Iterator<T>
true
if the iteration has more elementspublic T next()
java.util.Iterator
next
in interface Iterator<T>
public void remove()
java.util.Iterator
Iterator.next()
. The behavior of an iterator
is unspecified if the underlying collection is modified while the
iteration is in progress in any way other than by calling this
method.
remove
in interface Iterator<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |