org.apache.commons.collections

Class FilterIterator

Implemented Interfaces:
Iterator

public class FilterIterator
extends FilterIterator

A Proxy Iterator which takes a Predicate instance to filter out objects from an underlying Iterator instance. Only objects for which the specified Predicate evaluates to true are returned.
Authors:
James Strachan
Jan Sorensen
Since:
1.0

Constructor Summary

FilterIterator()
Constructs a new FilterIterator that will not function until setIterator is invoked.
FilterIterator(Iterator iterator)
Constructs a new FilterIterator that will not function until setPredicate is invoked.
FilterIterator(Iterator iterator, Predicate predicate)
Constructs a new FilterIterator that will use the given iterator and predicate.

Method Summary

Methods inherited from class org.apache.commons.collections.iterators.FilterIterator

getPredicate, hasNext, next, remove, setPredicate

Methods inherited from class org.apache.commons.collections.iterators.ProxyIterator

getIterator, hasNext, next, remove, setIterator

Constructor Details

FilterIterator

public FilterIterator()

FilterIterator

public FilterIterator(Iterator iterator)
Parameters:
iterator - the iterator to use

FilterIterator

public FilterIterator(Iterator iterator,
                      Predicate predicate)
Constructs a new FilterIterator that will use the given iterator and predicate.
Parameters:
iterator - the iterator to use
predicate - the predicate to use

Copyright © 2001-2004 Apache Software Foundation. Documenation generated ${TODAY}.