nz.ac.waikato.jdsl.core.ref
Class ArrayPositionIterator
java.lang.Object
nz.ac.waikato.jdsl.core.ref.AbstractArrayIterator
nz.ac.waikato.jdsl.core.ref.ArrayPositionIterator
- All Implemented Interfaces:
- ObjectIterator, PositionIterator
public class ArrayPositionIterator
- extends AbstractArrayIterator
- implements PositionIterator
An array-based positional iterator.
- Version:
- JDSL 2.1.1
- Author:
- Mike Boilen (mgb), Benoit Hudson (bh), Ryan Shaun Baker (rsb), Luca Vismara (lv), Mark Handy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
posArray_
protected Position[] posArray_
ArrayPositionIterator
public ArrayPositionIterator(Position[] 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.
ArrayPositionIterator
public ArrayPositionIterator(Position[] array,
int num)
throws BoundaryViolationException
- Traverses through the array, which is not copied, until
num elements have been returned.
- Throws:
BoundaryViolationException
position
public Position position()
throws java.util.NoSuchElementException
- Specified by:
position
in interface PositionIterator
- Returns:
- The position returned by the most recent next()
- Throws:
java.util.NoSuchElementException
- When the iterator is in its
initial, before-the-first-position state
nextPosition
public Position nextPosition()
throws java.util.NoSuchElementException
- Specified by:
nextPosition
in interface PositionIterator
- Returns:
- Next position to consider
- Throws:
java.util.NoSuchElementException
- if iterator has moved past
the last position to be seen
Copyright © 2009 ModelJUnit Project. All Rights Reserved.