| 
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenixst.plexus.traversals.BreadthFirstTraverser
public class BreadthFirstTraverser
A breadth-first Traverser for a Graph,
  with no cycle detection.  The first node returned is the start
  node, and no Edge is traversed to reach it.  All of
  the caveats concerning the ordering of the operations
  hasNext(), next(), and
  remove() detailed by the Traverser class
  documentation apply here.
| Constructor Summary | |
|---|---|
BreadthFirstTraverser(Object startNode,
                      Graph graph,
                      org.apache.commons.collections.Predicate traverserPredicate)
Creates a new BreadthFirstTraverser. | 
|
BreadthFirstTraverser(Object startNode,
                      Graph graph,
                      org.apache.commons.collections.Transformer traverserFactory)
Creates a new BreadthFirstTraverser. | 
|
BreadthFirstTraverser(Object startNode,
                      OrientedForest forest)
Creates a new BreadthFirstTraverser, which
  breadth-first traverses the descendants of the specified
  startNode. | 
|
BreadthFirstTraverser(Object startNode,
                      org.apache.commons.collections.Transformer traverserFactory)
Creates a new BreadthFirstTraverser. | 
|
| Method Summary | |
|---|---|
 Graph.Edge | 
getEdge()
Returns the Edge which was traversed to get to
  the last node returned by next(), or
  null if no Edge was traversed. | 
 boolean | 
hasNext()
 | 
 Object | 
next()
 | 
 void | 
prune()
Signals this Traverser to not explore beyond the
  last node returned by next(). | 
 void | 
remove()
Removes from the underlying Graph the last node
  returned by next(). | 
 void | 
removeEdge()
Removes from the underlying Graph the
  Edge that would be returned by getEdge(). | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public BreadthFirstTraverser(Object startNode,
                             Graph graph,
                             org.apache.commons.collections.Predicate traverserPredicate)
BreadthFirstTraverser.
public BreadthFirstTraverser(Object startNode,
                             OrientedForest forest)
BreadthFirstTraverser, which
  breadth-first traverses the descendants of the specified
  startNode.  The specified startNode
  cannot be removed by remove() when using this
  constructor.
public BreadthFirstTraverser(Object startNode,
                             org.apache.commons.collections.Transformer traverserFactory)
BreadthFirstTraverser.  The
  specified startNode cannot be removed by remove() when using this constructor.
public BreadthFirstTraverser(Object startNode,
                             Graph graph,
                             org.apache.commons.collections.Transformer traverserFactory)
BreadthFirstTraverser.  If the
  graph argument is null, the
  specified startNode cannot be removed by remove().
| Method Detail | 
|---|
public boolean hasNext()
hasNext in interface Iteratorpublic Object next()
next in interface Iteratorpublic void remove()
Graph the last node
  returned by next().  This will prevent the exploration
  of those nodes that would have been reached through the
  removed node (unless they are reachable by another route).
  This method can be called only once per call to
  next().  The behavior of this
  Traverser is unspecified if the underlying graph
  structure is modified while the traversal is in progress in
  any way other than by calling this method or removeEdge().
remove in interface IteratorIllegalStateException - if next() has not
  yet been called, or remove() or
  removeEdge has been called after the last call to
  next().public Graph.Edge getEdge()
TraverserEdge which was traversed to get to
  the last node returned by next(), or
  null if no Edge was traversed.  This
  call can be made only if remove() or removeEdge() has not been called after the last
  call to next().
getEdge in interface TraverserEdge which was traversed to get to
  the last node returned by next(), or
  null if no Edge was traversed.public void removeEdge()
Graph the
  Edge that would be returned by getEdge().  This will prevent the exploration of those nodes
  that would have been reached through the removed
  Edge (unless they are reachable by another
  route).
  Description copied from interface: Traverser
 Removes from the underlying Graph the
  Edge that would be returned by getEdge() (optional operation).  If no Edge was
  traversed (as in the root of a breadth-first search), this
  method throws a IllegalStateException.  This
  method can be called only once per call to next().  The behavior of a traverser is unspecified if the
  underlying graph structure is modified while the traversal is
  in progress in any way other than by calling this method or
  remove().
removeEdge in interface Traverserpublic void prune()
PruningTraverserTraverser to not explore beyond the
  last node returned by next().  This method can
  be called only once per call to next().  After
  calling this method (and before calling next()
  again), remove(), getEdge(),
  and removeEdge() will all throw
  IllegalStateExceptions.
prune in interface PruningTraverser
  | 
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||