Package com.ibm.wala.util.collections
Class ArrayIterator<T>
- java.lang.Object
-
- com.ibm.wala.util.collections.ArrayIterator<T>
-
- All Implemented Interfaces:
Iterator<T>
- Direct Known Subclasses:
ArrayNonNullIterator
public class ArrayIterator<T> extends Object implements Iterator<T>
an Iterator of array elements
-
-
Constructor Summary
Constructors Constructor Description ArrayIterator(T[] elts)ArrayIterator(T[] elts, int start)ArrayIterator(T[] elts, int start, int last)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tnext()voidremove()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
_cnt
protected int _cnt
The index of the next array element to return
-
last
protected final int last
The index of the last array element to return
-
_elts
protected final T[] _elts
The array source for the iterator
-
-
Constructor Detail
-
ArrayIterator
public ArrayIterator(T[] elts)
- Parameters:
elts- the array which should be iterated over
-
ArrayIterator
public ArrayIterator(T[] elts, int start)
- Parameters:
elts- the array which should be iterated overstart- the first array index to return
-
ArrayIterator
public ArrayIterator(T[] elts, int start, int last)
- Parameters:
elts- the array which should be iterated overstart- the first array index to return
-
-
Method Detail
-
next
public T next() throws NoSuchElementException
- Specified by:
nextin interfaceIterator<T>- Throws:
NoSuchElementException
-
remove
public void remove() throws UnsupportedOperationException- Specified by:
removein interfaceIterator<T>- Throws:
UnsupportedOperationException
-
-