|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nz.ac.waikato.jdsl.core.ref.ArrayObjectIterator
public class ArrayObjectIterator
An array-based object iterator.
Field Summary | |
---|---|
protected int |
iCurrentIndex_
|
protected int |
iLastIndex_
|
Constructor Summary | |
---|---|
ArrayObjectIterator(java.lang.Object[] array)
Uses the array to store the elements that this iterator traverses. |
|
ArrayObjectIterator(java.lang.Object[] array,
int num)
Traverses through the array, which is not copied, until num elements have been returned. |
Method Summary | |
---|---|
boolean |
hasNext()
Takes O(1) time |
java.lang.Object |
nextObject()
Takes O(1) time |
java.lang.Object |
object()
Takes O(1) time |
void |
reset()
Takes O(1) time |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int iCurrentIndex_
protected int iLastIndex_
Constructor Detail |
---|
public ArrayObjectIterator(java.lang.Object[] array)
array
- The elements that this iterator should traverse.public ArrayObjectIterator(java.lang.Object[] array, int num) throws BoundaryViolationException
BoundaryViolationException
Method Detail |
---|
public boolean hasNext()
hasNext
in interface ObjectIterator
public java.lang.Object nextObject()
nextObject
in interface ObjectIterator
public java.lang.Object object() throws java.util.NoSuchElementException
object
in interface ObjectIterator
java.util.NoSuchElementException
- When the iterator is in its
initial, before-the-first-object statepublic void reset()
reset
in interface ObjectIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |