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

java.lang.Object
  extended by com.ibm.wala.util.collections.FilterIterator<T>
All Implemented Interfaces:
java.util.Iterator<T>

public class FilterIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>

A FilterIterator filters an Iterator to generate a new one.


Constructor Summary
FilterIterator(java.util.Iterator<?> i, Filter f)
           
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterIterator

public FilterIterator(java.util.Iterator<?> i,
                      Filter f)
Parameters:
i - the original iterator
f - a filter which defines which elements belong to the generated iterator
Method Detail

next

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

hasNext

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

remove

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object