net.sf.staccatocommons.iterators.delayed
Class DelayedSingleIterator<A>
java.lang.Object
net.sf.staccatocommons.iterators.AbstractUnmodifiableIterator<A>
net.sf.staccatocommons.iterators.thriter.AbstractThriterator<A>
net.sf.staccatocommons.iterators.thriter.AdvanceThriterator<A>
net.sf.staccatocommons.iterators.SingleThriterator<A>
net.sf.staccatocommons.iterators.delayed.DelayedSingleIterator<A>
- All Implemented Interfaces:
- Iterator<A>, EmptyAware, Thriter<A>, Thriterator<A>
public class DelayedSingleIterator<A>
- extends SingleThriterator<A>
- Author:
- flbulgarelli
DelayedSingleIterator
public DelayedSingleIterator(@NonNull
Thunk<A> element)
- Creates a new
DelayedSingleIterator
current
public A current()
throws NoSuchElementException
- Description copied from interface:
Thriter
- Answers element at the current position of this
Thriter. Result of
this method if Thriter.advanceNext() was never evaluated before is
undefined.
- Specified by:
current in interface Thriter<A>- Overrides:
current in class SingleThriterator<A>
- Returns:
- the current element
- Throws:
NoSuchElementException
delayedCurrent
public Thunk<A> delayedCurrent()
- Description copied from interface:
Thriter
- Answers a
Thunk that, when evaluated through Thunk.value(),
will return the current element of this Thriter at the time of
being Thriter.delayedCurrent() sent.
This means, that the value of the returned thunk must must
always equals, even if this Thriter was advanced later.
- Specified by:
delayedCurrent in interface Thriter<A>- Overrides:
delayedCurrent in class AbstractThriterator<A>
- Returns:
- a
Thunk tha provides Thriter.current() at the time of this
message being sent.