org.jboss.util.collection
Class ArrayIterator

java.lang.Object
  extended byorg.jboss.util.collection.ArrayIterator
All Implemented Interfaces:
java.lang.Cloneable, java.util.Iterator, java.io.Serializable

public class ArrayIterator
extends java.lang.Object
implements java.util.Iterator, java.io.Serializable, java.lang.Cloneable

An array iterator.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object[] array
          Array to iterate over.
protected  int index
          The current position in the array.
 
Constructor Summary
ArrayIterator(java.lang.Object[] array)
          Construct an ArrayIterator.
 
Method Summary
 java.lang.Object clone()
          Returns a shallow cloned copy of this object.
 boolean hasNext()
          Returns true if there are more elements in the iteration.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove()
          Unsupported.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

array

protected final java.lang.Object[] array
Array to iterate over.


index

protected int index
The current position in the array.

Constructor Detail

ArrayIterator

public ArrayIterator(java.lang.Object[] array)
Construct an ArrayIterator.

Parameters:
array - The array to iterate over.
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more elements in the iteration.

Specified by:
hasNext in interface java.util.Iterator
Returns:
True if there are more elements in the iteration.

next

public java.lang.Object next()
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
The next element in the iteration.
Throws:
java.util.NoSuchElementException - The are no more elements available.

remove

public void remove()
Unsupported.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException

clone

public java.lang.Object clone()
Returns a shallow cloned copy of this object.

Returns:
A shallow cloned copy of this object.