commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1204191 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java
Date Sun, 20 Nov 2011 17:09:29 GMT
Author: simonetripodi
Date: Sun Nov 20 17:09:29 2011
New Revision: 1204191

URL: http://svn.apache.org/viewvc?rev=1204191&view=rev
Log:
don't perform graph visit inside the handler, just let the DFS algorithm doing it and handle
visit events

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java?rev=1204191&r1=1204190&r2=1204191&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java
Sun Nov 20 17:09:29 2011
@@ -54,7 +54,6 @@ final class CheriyanMehlhornGabowVisitHa
         this.marked = marked;
     }
 
-
     /**
      * {@inheritDoc}
      */
@@ -64,15 +63,18 @@ final class CheriyanMehlhornGabowVisitHa
         marked.add( vertex );
         s.push( vertex );
         p.push( vertex );
+    }
 
-        for ( V adjacent : graph.getOutbound( vertex ) )
+    /**
+     * {@inheritDoc}
+     */
+    public void discoverEdge( V head, E edge, V tail )
+    {
+        if ( !marked.contains( tail ) )
         {
-            if ( !marked.contains( adjacent ) )
-            {
-                depthFirstSearch( graph, adjacent, this );
-            }
-            // TODO else...
+            depthFirstSearch( graph, tail, this );
         }
+        // TODO else...
     }
 
 }



Mime
View raw message