Package org.jboss.util.collection
Class ArrayIterator
- java.lang.Object
-
- org.jboss.util.collection.ArrayIterator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Iterator
public class ArrayIterator extends java.lang.Object implements java.util.Iterator, java.io.Serializable, java.lang.Cloneable
An array iterator.- Version:
- $Revision$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object[]
array
Array to iterate over.protected int
index
The current position in the array.private static long
serialVersionUID
The serialVersionUID
-
Constructor Summary
Constructors Constructor Description ArrayIterator(java.lang.Object[] array)
Construct an ArrayIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serialVersionUID- See Also:
- Constant Field Values
-
array
protected final java.lang.Object[] array
Array to iterate over.
-
index
protected int index
The current position in the array.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns true if there are more elements in the iteration.- Specified by:
hasNext
in interfacejava.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 interfacejava.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 interfacejava.util.Iterator
- Throws:
java.lang.UnsupportedOperationException
-
clone
public java.lang.Object clone()
Returns a shallow cloned copy of this object.- Overrides:
clone
in classjava.lang.Object
- Returns:
- A shallow cloned copy of this object.
-
-