com.ibm.wala.util.collections
Class ArrayIterator<T>

java.lang.Object
  extended by 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


Field Summary
protected  int _cnt
          The index of the next array element to return
protected  T[] _elts
          The array source for the iterator
protected  int last
          The index of the last array element to return
 
Constructor Summary
ArrayIterator(T[] elts)
           
ArrayIterator(T[] elts, int start)
           
ArrayIterator(T[] elts, int start, int last)
           
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 over
start - the first array index to return

ArrayIterator

public ArrayIterator(T[] elts,
                     int start,
                     int last)
Parameters:
elts - the array which should be iterated over
start - the first array index to return
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<T>

next

public T next()
       throws java.util.NoSuchElementException
Specified by:
next in interface java.util.Iterator<T>
Throws:
java.util.NoSuchElementException

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Specified by:
remove in interface java.util.Iterator<T>
Throws:
java.lang.UnsupportedOperationException