com.phoenixst.plexus.util

Class FilteredNodeIterator

public class FilteredNodeIterator extends FilteredIterator

A simple filtered node Iterator. Because this class must advance the underlying Iterator to function properly, implementing FilteredNodeIterator may delegate to Graph.removeNode( node ) in some situations.

Since: 1.0

Version: $Revision: 1.8 $

Author: Ray A. Conner

Constructor Summary
FilteredNodeIterator(Iterator nodeIter, Predicate nodePredicate)
Creates a new FilteredNodeIterator which will throw an IllegalStateException if remove() is called after hasNext() without an intervening call to next().
FilteredNodeIterator(Graph graph, Iterator nodeIter, Predicate nodePredicate)
Creates a new FilteredNodeIterator which will have FilteredNodeIterator delegate to Graph.removeNode( node ) if necessary.
Method Summary
protected voidremove(Object object)
If the Graph specified in the constructor is not null, this implementation will delegate to Graph.removeNode( node ) (which may invalidate this Iterator).

Constructor Detail

FilteredNodeIterator

public FilteredNodeIterator(Iterator nodeIter, Predicate nodePredicate)
Creates a new FilteredNodeIterator which will throw an IllegalStateException if remove() is called after hasNext() without an intervening call to next().

FilteredNodeIterator

public FilteredNodeIterator(Graph graph, Iterator nodeIter, Predicate nodePredicate)
Creates a new FilteredNodeIterator which will have FilteredNodeIterator delegate to Graph.removeNode( node ) if necessary. Depending upon the Graph implementation, this may invalidate this Iterator.

Method Detail

remove

protected void remove(Object object)
If the Graph specified in the constructor is not null, this implementation will delegate to Graph.removeNode( node ) (which may invalidate this Iterator). If the Graph specified in the constructor is null, or if the other constructor is used, this implementation throws an IllegalStateException.

Description copied from class: FilteredIterator
{@inheritDoc }

See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.