|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jmlspecs.jmlunit.strategies.NewObjectAbstractIterator
An iterator that provides test data by creating (in general) the objects each time the get() method is called. The idea is to track a number for what item to return, and to pass that to a "make" method which creates the required object, or throws an exception if there are no more.
If you want to have aliasing, arrange it so that the same object is returned multiple times by the get() method.
This can only handle iterations up to Integer.MAX_VALUE elements.
| Field Summary | |
private boolean |
atEnd
Is this iteration at it's end? |
private int |
cursor
The number of the current data item to return. |
| Constructor Summary | |
NewObjectAbstractIterator()
|
|
| 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. |
void |
initialize()
Initialize this iterator. |
abstract Object |
make(int n)
Return the nth test data item. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private boolean atEnd
private int cursor
| Constructor Detail |
public NewObjectAbstractIterator()
| Method Detail |
public void initialize()
NewObjectAbstractStrategypublic void advance()
IndefiniteIterator
advance in interface IndefiniteIteratorpublic boolean atEnd()
IndefiniteIterator
atEnd in interface IndefiniteIteratorpublic Object get()
IndefiniteIterator
get in interface IndefiniteIteratorpublic abstract Object make(int n)
public Object clone()
IndefiniteIterator
clone in interface IndefiniteIteratorclone in class Object
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||