nz.ac.waikato.jdsl.core.ref
Class ArrayLocatorIterator

java.lang.Object
  extended by nz.ac.waikato.jdsl.core.ref.AbstractArrayIterator
      extended by 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)

Field Summary
protected  Locator[] locArray_
           
 
Fields inherited from class nz.ac.waikato.jdsl.core.ref.AbstractArrayIterator
iCurrentIndex_, iLastIndex_
 
Constructor Summary
ArrayLocatorIterator(Locator[] array)
          Uses the array to store the elements that this iterator traverses.
ArrayLocatorIterator(Locator[] array, int num)
          Traverses through the array, which is not copied, until num elements have been returned.
 
Method Summary
 java.lang.Object key()
          Shortcut for locator().key()
 Locator locator()
           
 Locator nextLocator()
           
 
Methods inherited from class nz.ac.waikato.jdsl.core.ref.AbstractArrayIterator
checkBeforeStart, element, hasNext, nextAccessor, nextObject, object, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.jdsl.core.api.LocatorIterator
element
 
Methods inherited from interface nz.ac.waikato.jdsl.core.api.ObjectIterator
hasNext, nextObject, object, reset
 

Field Detail

locArray_

protected Locator[] locArray_
Constructor Detail

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
Method Detail

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.