Package com.ibm.wala.util.collections
Class ArrayIterator<T>
- java.lang.Object
-
- com.ibm.wala.util.collections.ArrayIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
- Direct Known Subclasses:
ArrayNonNullIterator
public class ArrayIterator<T> extends java.lang.Object implements java.util.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()
-
-
-
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
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<T>
-
next
public T next() throws java.util.NoSuchElementException
- Specified by:
nextin interfacejava.util.Iterator<T>- Throws:
java.util.NoSuchElementException
-
remove
public void remove() throws java.lang.UnsupportedOperationException- Specified by:
removein interfacejava.util.Iterator<T>- Throws:
java.lang.UnsupportedOperationException
-
-