org.apache.commons.collections
Class FilterIterator

java.lang.Object
  |
  +--org.apache.commons.collections.ProxyIterator
        |
        +--org.apache.commons.collections.FilterIterator
All Implemented Interfaces:
Iterator

public class FilterIterator
extends ProxyIterator

A Proxy Iterator which takes a Predicate instance to filter out objects from an underlying Iterator instance.

Author:
James Strachan

Constructor Summary
FilterIterator()
           
FilterIterator(Iterator iterator)
           
FilterIterator(Iterator iterator, Predicate predicate)
           
 
Method Summary
 Predicate getPredicate()
          Getter for property predicate.
 boolean hasNext()
           
 Object next()
           
 void setPredicate(Predicate predicate)
          Setter for property predicate.
 
Methods inherited from class org.apache.commons.collections.ProxyIterator
getIterator, remove, setIterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterIterator

public FilterIterator()

FilterIterator

public FilterIterator(Iterator iterator)

FilterIterator

public FilterIterator(Iterator iterator,
                      Predicate predicate)
Method Detail

getPredicate

public Predicate getPredicate()
Getter for property predicate.
Returns:
Value of property predicate.

hasNext

public boolean hasNext()
Overrides:
hasNext in class ProxyIterator

next

public Object next()
Overrides:
next in class ProxyIterator

setPredicate

public void setPredicate(Predicate predicate)
Setter for property predicate.
Parameters:
predicate - New value of property predicate.


Copyright © 2001 Apache Software Foundation. Documenation generated July 14 2001.