jdsl.core.ref
Class AbstractArrayIterator
java.lang.Object
|
+--jdsl.core.ref.AbstractArrayIterator
- Direct Known Subclasses:
- ArrayLocatorIterator, ArrayPositionIterator
- public abstract class AbstractArrayIterator
- extends java.lang.Object
A class abstracting the common parts of ArrayPositionIterator and
ArrayLocatorIterator.
- Version:
- JDSL 2.0.6
- Author:
- Luca Vismara (lv)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iCurrentIndex_
protected int iCurrentIndex_
iLastIndex_
protected int iLastIndex_
AbstractArrayIterator
protected AbstractArrayIterator(Accessor[] array)
- Uses the array to store the elements that this iterator
traverses. The array is NOT copied.
- Parameters:
array
- The elements that this iterator should traverse.
AbstractArrayIterator
protected AbstractArrayIterator(Accessor[] array,
int num)
throws BoundaryViolationException
- Traverses through the array until the first
num elements have been returned. The array is NOT copied.
hasNext
public boolean hasNext()
element
public java.lang.Object element()
throws java.util.NoSuchElementException
nextObject
public java.lang.Object nextObject()
- Takes O(1) time
object
public java.lang.Object object()
throws java.util.NoSuchElementException
- Takes O(1) time
reset
public void reset()
- Takes O(1) time
checkBeforeStart
protected void checkBeforeStart()
throws java.util.NoSuchElementException
nextAccessor
protected Accessor nextAccessor()