JML

org.jmlspecs.jmlunit.strategies
Interface IndefiniteIterator

All Superinterfaces:
Cloneable
All Known Subinterfaces:
BooleanIterator, ByteIterator, CharIterator, DoubleIterator, FloatIterator, IntIterator, LongIterator, ShortIterator
All Known Implementing Classes:
AbstractFilteringIteratorDecorator, BooleanAbstractIterator, ByteAbstractIterator, CharAbstractIterator, CompositeIterator, DoubleAbstractIterator, FloatAbstractIterator, IntAbstractIterator, IteratorAbstractAdapter, LongAbstractIterator, NewObjectAbstractIterator, ObjectArrayAbstractIterator, ShortAbstractIterator

public interface IndefiniteIterator
extends Cloneable

Indefinite iterators. These can also be thought of as cursors that point into a sequence.

Version:
$Revision: 1.9 $
Author:
Gary T. Leavens
See Also:
Iterator

Method Summary
 void advance()
          Advance the state of this iteration to the next position.
 boolean atEnd()
          Is this iterator at its end?
 Object clone()
          Return a copy of this iterator in the same state as this object.
 Object get()
          Return the current element in this iteration.
 

Method Detail

atEnd

public boolean atEnd()
Is this iterator at its end? That is, if we called get(), would it throw an exception?


get

public Object get()
Return the current element in this iteration. This method may be called multiple times, and does not advance the state of the iterator when it is called. The idea is to permit several similar copies to be returned (e.g., clones) each time it is called.

Throws:
NoSuchElementException, - when atEnd() is true.

advance

public void advance()
Advance the state of this iteration to the next position. Note that this never throws an exception.


clone

public Object clone()
Return a copy of this iterator in the same state as this object.


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.