public class FilteredNodeIterator extends FilteredIterator
Iterator
. Because this class
must advance the underlying Iterator
to function
properly, implementing remove(java.lang.Object)
may delegate to Graph.removeNode( node )
in some situations.Constructor and Description |
---|
FilteredNodeIterator(Graph graph,
Iterator nodeIter,
org.apache.commons.collections.Predicate nodePredicate)
Creates a new
FilteredNodeIterator which will
have FilteredIterator.remove() delegate to Graph.removeNode( node ) if
necessary. |
FilteredNodeIterator(Iterator nodeIter,
org.apache.commons.collections.Predicate nodePredicate)
Creates a new
FilteredNodeIterator which will
throw an IllegalStateException if
remove() is called after hasNext()
without an intervening call to next() . |
Modifier and Type | Method and Description |
---|---|
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 ). |
hasNext, next, remove
public FilteredNodeIterator(Iterator nodeIter, org.apache.commons.collections.Predicate nodePredicate)
FilteredNodeIterator
which will
throw an IllegalStateException
if
remove()
is called after hasNext()
without an intervening call to next()
.public FilteredNodeIterator(Graph graph, Iterator nodeIter, org.apache.commons.collections.Predicate nodePredicate)
FilteredNodeIterator
which will
have FilteredIterator.remove()
delegate to Graph.removeNode( node )
if
necessary. Depending upon the Graph
implementation, this may invalidate this
Iterator
.protected void remove(Object object)
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
This method is called by FilteredIterator.remove()
if
hasNext()
was called after the last calls to both
next()
and remove()
(if any) and
remove()
has not been called after the last call
to next()
. In other words, this method is called
if the call sequence goes something like next(),
hasNext(), remove()
, which means the underlying
Iterator
has been advanced beyond the element to
be removed. This provides an extension point for an
implementation to correctly handle this case if it is capable
of doing so.
This implementation throws an
IllegalStateException
.
remove
in class FilteredIterator
See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.