info.javelot.functionalj.util
Class ArrayIterator<T>

java.lang.Object
  extended by info.javelot.functionalj.util.ArrayIterator<T>
All Implemented Interfaces:
Iterator<T>

public class ArrayIterator<T>
extends Object
implements Iterator<T>

Iterator that is used for arrays.

Author:
Copyright © 2006 Frederic Daoud

Constructor Summary
ArrayIterator(T[] p_array)
           
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 T next()
          Returns the next element in the iteration of the array.
 void remove()
          Throws a UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayIterator

public ArrayIterator(T[] p_array)
Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements.

Specified by:
hasNext in interface Iterator<T>
Returns:
true if the iteration has more elements.

next

public T next()
       throws NoSuchElementException
Returns the next element in the iteration of the array.

Specified by:
next in interface Iterator<T>
Returns:
the next element in the iteration.
Throws:
NoSuchElementException - thrown if this method is called and the iteration is past the end of the array.

remove

public void remove()
Throws a UnsupportedOperationException.

Specified by:
remove in interface Iterator<T>