|
||||||||||
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.AbstractArrayIterator
public abstract class AbstractArrayIterator
A class abstracting the common parts of ArrayPositionIterator and ArrayLocatorIterator.
Field Summary | |
---|---|
protected int |
iCurrentIndex_
|
protected int |
iLastIndex_
|
Constructor Summary | |
---|---|
protected |
AbstractArrayIterator(Accessor[] array)
Uses the array to store the elements that this iterator traverses. |
protected |
AbstractArrayIterator(Accessor[] array,
int num)
Traverses through the array until the first num elements have been returned. |
Method Summary | |
---|---|
protected void |
checkBeforeStart()
|
java.lang.Object |
element()
|
boolean |
hasNext()
|
protected Accessor |
nextAccessor()
|
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 |
---|
protected AbstractArrayIterator(Accessor[] array)
array
- The elements that this iterator should traverse.protected AbstractArrayIterator(Accessor[] array, int num) throws BoundaryViolationException
BoundaryViolationException
Method Detail |
---|
public boolean hasNext()
public java.lang.Object element() throws java.util.NoSuchElementException
java.util.NoSuchElementException
public java.lang.Object nextObject()
public java.lang.Object object() throws java.util.NoSuchElementException
java.util.NoSuchElementException
public void reset()
protected void checkBeforeStart() throws java.util.NoSuchElementException
java.util.NoSuchElementException
protected Accessor nextAccessor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |