org._3pq.jgrapht.traverse

Class AbstractGraphIterator

Implemented Interfaces:
GraphIterator, Iterator
Known Direct Subclasses:
CrossComponentIterator

public abstract class AbstractGraphIterator
extends java.lang.Object
implements GraphIterator

An empty implementation of a graph iterator to minimize the effort required to implement graph iterators.
Author:
Barak Naveh
Since:
Jul 19, 2003

Method Summary

void
addTraversalListener(TraversalListener l)
Adds the specified traversal listener to this iterator.
protected void
fireConnectedComponentFinished(ConnectedComponentTraversalEvent e)
Informs all listeners that the traversal of the current connected component finished.
protected void
fireConnectedComponentStarted(ConnectedComponentTraversalEvent e)
Informs all listeners that a traversal of a new connected component has started.
protected void
fireEdgeTraversed(EdgeTraversalEvent e)
Informs all listeners that a the specified edge was visited.
protected void
fireVertexTraversed(VertexTraversalEvent e)
Informs all listeners that a the specified vertex was visited.
boolean
isCrossComponentTraversal()
Test whether this iterator is set to traverse the graph across connected components.
boolean
isReuseEvents()
void
remove()
Unsupported.
void
removeTraversalListener(TraversalListener l)
Removes the specified traversal listener from this iterator.
void
setCrossComponentTraversal(boolean crossComponentTraversal)
Sets the cross component traversal flag - indicates whether to traverse the graph across connected components.
void
setReuseEvents(boolean reuseEvents)

Method Details

addTraversalListener

public void addTraversalListener(TraversalListener l)
Adds the specified traversal listener to this iterator.
Specified by:
addTraversalListener in interface GraphIterator
Parameters:
l - the traversal listener to be added.

fireConnectedComponentFinished

protected void fireConnectedComponentFinished(ConnectedComponentTraversalEvent e)
Informs all listeners that the traversal of the current connected component finished.
Parameters:
e - the connected component finished event.

fireConnectedComponentStarted

protected void fireConnectedComponentStarted(ConnectedComponentTraversalEvent e)
Informs all listeners that a traversal of a new connected component has started.
Parameters:
e - the connected component started event.

fireEdgeTraversed

protected void fireEdgeTraversed(EdgeTraversalEvent e)
Informs all listeners that a the specified edge was visited.
Parameters:
e - the edge traversal event.

fireVertexTraversed

protected void fireVertexTraversed(VertexTraversalEvent e)
Informs all listeners that a the specified vertex was visited.
Parameters:
e - the vertex traversal event.

isCrossComponentTraversal

public boolean isCrossComponentTraversal()
Test whether this iterator is set to traverse the graph across connected components.
Specified by:
isCrossComponentTraversal in interface GraphIterator
Returns:
true if traverses across connected components, otherwise false.

isReuseEvents

public boolean isReuseEvents()
Specified by:
isReuseEvents in interface GraphIterator

remove

public void remove()
Unsupported.
Specified by:
remove in interface GraphIterator

removeTraversalListener

public void removeTraversalListener(TraversalListener l)
Removes the specified traversal listener from this iterator.
Specified by:
removeTraversalListener in interface GraphIterator
Parameters:
l - the traversal listener to be removed.

setCrossComponentTraversal

public void setCrossComponentTraversal(boolean crossComponentTraversal)
Sets the cross component traversal flag - indicates whether to traverse the graph across connected components.
Parameters:
crossComponentTraversal - if true traverses across connected components.

setReuseEvents

public void setReuseEvents(boolean reuseEvents)
Specified by:
setReuseEvents in interface GraphIterator