org.jikesrvm.compilers.opt.util
Class FilterIterator<T>

java.lang.Object
  extended by org.jikesrvm.compilers.opt.util.FilterIterator<T>
All Implemented Interfaces:
Iterator<T>

public class FilterIterator<T>
extends Object
implements Iterator<T>

A FilterIterator filters and maps a source Iterator to generate a new one.


Nested Class Summary
static class FilterIterator.Filter<T>
           
 
Field Summary
private  boolean done
           
(package private)  FilterIterator.Filter<T> f
           
(package private)  Iterator<T> i
           
private  T next
           
 
Constructor Summary
FilterIterator(Iterator<T> i, FilterIterator.Filter<T> f)
           
 
Method Summary
private  void advance()
           
 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

i

final Iterator<T> i

f

final FilterIterator.Filter<T> f

next

private T next

done

private boolean done
Constructor Detail

FilterIterator

public FilterIterator(Iterator<T> i,
                      FilterIterator.Filter<T> f)
Method Detail

advance

private void advance()

next

public T next()
Specified by:
next in interface Iterator<T>

hasNext

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

remove

public void remove()
Specified by:
remove in interface Iterator<T>