net.sf.staccatocommons.iterators.thriter
Class AbstractThriterator<A>

java.lang.Object
  extended by net.sf.staccatocommons.iterators.AbstractUnmodifiableIterator<A>
      extended by net.sf.staccatocommons.iterators.thriter.AbstractThriterator<A>
All Implemented Interfaces:
Iterator<A>, EmptyAware, Thriter<A>, Thriterator<A>
Direct Known Subclasses:
AdvanceThriterator, EmptyThriterator, NextThriterator

public abstract class AbstractThriterator<A>
extends AbstractUnmodifiableIterator<A>
implements Thriterator<A>

Author:
flbulgarelli

Constructor Summary
AbstractThriterator()
           
 
Method Summary
 Thunk<A> delayedCurrent()
          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.
 Thunk<A> delayedNext()
          Advances this thriter and the returns Thriter.delayedCurrent()
 boolean isEmpty()
          Answers if this Thriterator is empty
 
Methods inherited from class net.sf.staccatocommons.iterators.AbstractUnmodifiableIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.staccatocommons.iterators.thriter.Thriter
advanceNext, current, hasNext
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Constructor Detail

AbstractThriterator

public AbstractThriterator()
Method Detail

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>
Returns:
a Thunk tha provides Thriter.current() at the time of this message being sent.

delayedNext

public final Thunk<A> delayedNext()
Description copied from interface: Thriter
Advances this thriter and the returns Thriter.delayedCurrent()

Specified by:
delayedNext in interface Thriter<A>
Returns:
Thriter.delayedCurrent()

isEmpty

public final boolean isEmpty()
Description copied from interface: Thriterator
Answers if this Thriterator is empty

Specified by:
isEmpty in interface EmptyAware
Specified by:
isEmpty in interface Thriterator<A>
Returns:
!hasNext()


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads