You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/06/13 21:47:03 UTC

svn commit: r1135251 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java

Author: simonetripodi
Date: Mon Jun 13 19:47:01 2011
New Revision: 1135251

URL: http://svn.apache.org/viewvc?rev=1135251&view=rev
Log:
added overloaded search methods without any handler
APIs still need to be well defined, maybe the default methods can return the visit list

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java?rev=1135251&r1=1135250&r2=1135251&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java Mon Jun 13 19:47:01 2011
@@ -41,6 +41,19 @@ public final class Visit
      * @param <E> the Graph edges type
      * @param graph the Graph instance has to be visited
      * @param source the root node the search begins from
+     */
+    public final <V extends Vertex, E extends Edge<V>> void breadthFirstSearch( Graph<V, E> graph, V source )
+    {
+        breadthFirstSearch( graph, source, null );
+    }
+
+    /**
+     * Breadth-first search algorithm implementation.
+     *
+     * @param <V> the Graph vertices type
+     * @param <E> the Graph edges type
+     * @param graph the Graph instance has to be visited
+     * @param source the root node the search begins from
      * @param handler the handler intercepts visit actions
      */
     public final <V extends Vertex, E extends Edge<V>> void breadthFirstSearch( Graph<V, E> graph, V source,
@@ -114,6 +127,19 @@ public final class Visit
      * @param <E> the Graph edges type
      * @param graph the Graph instance has to be visited
      * @param source the root node the search begins from
+     */
+    public final <V extends Vertex, E extends Edge<V>> void depthFirstSearch( Graph<V, E> graph, V source )
+    {
+        depthFirstSearch( graph, source, null );
+    }
+
+    /**
+     * Depth-first search algorithm implementation.
+     *
+     * @param <V> the Graph vertices type
+     * @param <E> the Graph edges type
+     * @param graph the Graph instance has to be visited
+     * @param source the root node the search begins from
      * @param handler the handler intercepts visit actions
      */
     public final <V extends Vertex, E extends Edge<V>> void depthFirstSearch( Graph<V, E> graph, V source,