org.jqurantree.core.collections
Class ArrayIterator<T>

java.lang.Object
  extended by org.jqurantree.core.collections.ImmutableIteratorBase<T>
      extended by org.jqurantree.core.collections.ArrayIterator<T>
Type Parameters:
T - the type of array element supported by this iterator
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Iterator<T>

public class ArrayIterator<T>
extends ImmutableIteratorBase<T>
implements java.lang.Iterable<T>

Supports iterating over an array without modifying the underlying values.

Author:
Kais Dukes

Constructor Summary
ArrayIterator(T[] items)
           
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.util.Iterator<T> iterator()
          Returns the iterator.
 T next()
          Returns the next element in the iteration.
 
Methods inherited from class org.jqurantree.core.collections.ImmutableIteratorBase
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayIterator

public ArrayIterator(T[] items)
Method Detail

iterator

public java.util.Iterator<T> iterator()
Returns the iterator.

Specified by:
iterator in interface java.lang.Iterable<T>
Returns:
the same iterator instance.

hasNext

public boolean hasNext()
Description copied from class: ImmutableIteratorBase
Returns true if the iteration has more elements.

Specified by:
hasNext in interface java.util.Iterator<T>
Specified by:
hasNext in class ImmutableIteratorBase<T>
Returns:
true if the iterator has more elements.

next

public T next()
Description copied from class: ImmutableIteratorBase
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator<T>
Specified by:
next in class ImmutableIteratorBase<T>
Returns:
the next element in the iteration.


Copyright© Kais Dukes, 2009. All Rights Reserved.