org.eigenbase.util
Class Filterator<E>

java.lang.Object
  extended by org.eigenbase.util.Filterator<E>
All Implemented Interfaces:
Iterator<E>

public class Filterator<E>
extends Object
implements Iterator<E>

Filtered iterator class: an iterator that includes only elements that are instanceof a specified class. Apologies for the dorky name.

Since:
November 9, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/util/Filterator.java#7 $
Author:
jason
See Also:
Util.cast(List, Class), Util.cast(Iterator, Class)

Field Summary
(package private)  Class<E> includeFilter
           
(package private)  Iterator<? extends Object> iterator
           
(package private)  E lookAhead
           
(package private)  boolean ready
           
 
Constructor Summary
Filterator(Iterator<?> iterator, Class<E> includeFilter)
           
 
Method Summary
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includeFilter

Class<E> includeFilter

iterator

Iterator<? extends Object> iterator

lookAhead

E lookAhead

ready

boolean ready
Constructor Detail

Filterator

public Filterator(Iterator<?> iterator,
                  Class<E> includeFilter)
Method Detail

hasNext

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

next

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

remove

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