nz.ac.waikato.jdsl.core.ref
Class ArrayLocatorIterator
java.lang.Object
nz.ac.waikato.jdsl.core.ref.AbstractArrayIterator
nz.ac.waikato.jdsl.core.ref.ArrayLocatorIterator
- All Implemented Interfaces:
- LocatorIterator, ObjectIterator
public class ArrayLocatorIterator
- extends AbstractArrayIterator
- implements LocatorIterator
An array-based locator iterator.
- Version:
- JDSL 2.1.1
- Author:
- Luca Vismara (lv)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
locArray_
protected Locator[] locArray_
ArrayLocatorIterator
public ArrayLocatorIterator(Locator[] 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.
ArrayLocatorIterator
public ArrayLocatorIterator(Locator[] array,
int num)
throws BoundaryViolationException
- Traverses through the array, which is not copied, until
num elements have been returned.
- Throws:
BoundaryViolationException
locator
public Locator locator()
throws java.util.NoSuchElementException
- Specified by:
locator
in interface LocatorIterator
- Returns:
- The locator returned by the most recent next()
- Throws:
java.util.NoSuchElementException
- When the iterator is in its
initial, before-the-first-locator state
key
public java.lang.Object key()
throws java.util.NoSuchElementException
- Description copied from interface:
LocatorIterator
- Shortcut for locator().key()
- Specified by:
key
in interface LocatorIterator
- Returns:
- Key of the locator that would be returned by locator()
- Throws:
java.util.NoSuchElementException
- When the iterator is in its
initial, before-the-first-locator state
nextLocator
public Locator nextLocator()
throws java.util.NoSuchElementException
- Specified by:
nextLocator
in interface LocatorIterator
- Returns:
- Next locator to consider
- Throws:
java.util.NoSuchElementException
- if iterator has moved past
the last locator
Copyright © 2009 ModelJUnit Project. All Rights Reserved.