net.sf.staccatocommons.iterators
Class IndexedThriterator<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.IndexedThriterator<A>
- All Implemented Interfaces:
- Iterator<A>, EmptyAware, Thriter<A>, Thriterator<A>
- Direct Known Subclasses:
- ArrayThriterator, CharSequenceThriterator
public abstract class IndexedThriterator<A>
- extends AdvanceThriterator<A>
- Author:
- flbulgarelli
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IndexedThriterator
public IndexedThriterator()
hasNext
public final boolean hasNext()
- Description copied from interface:
Thriter
- Answers if the thriter has more elements, that is, if sending
Thriter.advanceNext() would not result in a NoSuchElementException
- Returns:
- if the
Thriter has more elements
advanceNext
public final void advanceNext()
throws NoSuchElementException
- Description copied from interface:
Thriter
- Advances to the thriter to the position of the next element.
- Throws:
NoSuchElementException - if there are no more elements
current
public final 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.
- Returns:
- the current element
- Throws:
NoSuchElementException
elementAt
protected abstract A elementAt(int position)
length
protected abstract int length()