Iterator edges;
// First dive down edges.
edges = graph.getEdgesFrom( node ).iterator();
while ( edges.hasNext() )
{
DependencyGraphEdge e = (DependencyGraphEdge) edges.next();
if ( this.edgePredicate.evaluate( e ) )
{
visitEdge( graph, e, visitor );
}
}
// Next move down edges.
edges = graph.getEdgesFrom( node ).iterator();
while ( edges.hasNext() )
{
DependencyGraphEdge e = (DependencyGraphEdge) edges.next();
if ( this.edgePredicate.evaluate( e ) )
{
DependencyGraphNode nodeTo = graph.getNode( e.getNodeTo() );
Integer state = getNodeVisitState( nodeTo );
if ( ( state == UNSEEN ) || ( state == PROCESSING ) )
{
visitNode( graph, nodeTo, visitor );
}