You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2012/03/04 11:31:38 UTC
svn commit: r1296776 - in
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph:
scc/DefaultSccAlgorithmSelector.java
spanning/DefaultSpanningTreeAlgorithmSelector.java
visit/DefaultVisitAlgorithmsSelector.java
Author: tn
Date: Sun Mar 4 10:31:38 2012
New Revision: 1296776
URL: http://svn.apache.org/viewvc?rev=1296776&view=rev
Log:
minor javadoc and checkstyle fixes for algorithm selectors.
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/DefaultVisitAlgorithmsSelector.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java?rev=1296776&r1=1296775&r2=1296776&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java Sun Mar 4 10:31:38 2012
@@ -51,10 +51,15 @@ import org.apache.commons.graph.visit.Gr
public final class DefaultSccAlgorithmSelector<V extends Vertex, E extends Edge, G extends DirectedGraph<V, E>>
implements SccAlgorithmSelector<V, E, G>
{
-
+ /** The graph. */
private final G graph;
- public DefaultSccAlgorithmSelector( G graph )
+ /**
+ * Create a default {@link SccAlgorithmSelector} for the given {@link Graph}.
+ *
+ * @param graph the {@link Graph}.
+ */
+ public DefaultSccAlgorithmSelector( final G graph )
{
this.graph = graph;
}
@@ -163,14 +168,14 @@ public final class DefaultSccAlgorithmSe
* <p><b>Implementation Note:</b> in the first step we look for vertices that have not
* been visited yet, while in the second step we search for vertices that have already
* been visited.</p>
- * @param graph the graph to be search
+ * @param g the graph to be search
* @param source the start vertex
* @param coll the recursive collection of visited vertices
* @param visited contains vertices that have been already visited
* @param forward <code>true</code> for the first step of Kosaraju's algorithm,
* <code>false</code> for the second step.
*/
- private void searchRecursive( final DirectedGraph<V, E> graph, final V source,
+ private void searchRecursive( final DirectedGraph<V, E> g, final V source,
final Collection<V> coll, final Set<V> visited,
final boolean forward )
{
@@ -206,7 +211,7 @@ public final class DefaultSccAlgorithmSe
// add all not yet visited vertices that can be reached from this
// vertex to the stack
- for ( V w : graph.getOutbound( v ) )
+ for ( V w : g.getOutbound( v ) )
{
if ( ! ( forward ^ ! visited.contains( w ) ) )
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java?rev=1296776&r1=1296775&r2=1296776&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java Sun Mar 4 10:31:38 2012
@@ -51,12 +51,20 @@ import org.apache.commons.graph.weight.O
final class DefaultSpanningTreeAlgorithmSelector<V extends Vertex, W, WE extends WeightedEdge<W>, G extends Graph<V, WE>>
implements SpanningTreeAlgorithmSelector<V, W, WE, G>
{
-
+ /** The graph. */
private final G graph;
+ /** The start {@link Vertex}. */
private final V source;
- public DefaultSpanningTreeAlgorithmSelector( G graph, V source )
+ /**
+ * Creates a default {@link SpanningTreeAlgorithmSelector} for the given {@link Graph} and
+ * start {@link Vertex}.
+ *
+ * @param graph the {@link Graph} to be used.
+ * @param source the start {@link Vertex}.
+ */
+ public DefaultSpanningTreeAlgorithmSelector( final G graph, final V source )
{
this.graph = graph;
this.source = source;
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/DefaultVisitAlgorithmsSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/DefaultVisitAlgorithmsSelector.java?rev=1296776&r1=1296775&r2=1296776&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/DefaultVisitAlgorithmsSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/DefaultVisitAlgorithmsSelector.java Sun Mar 4 10:31:38 2012
@@ -43,11 +43,20 @@ final class DefaultVisitAlgorithmsSelect
implements VisitAlgorithmsSelector<V, E, G>
{
+ /** The graph. */
private final G graph;
+ /** The start vertex for the search. */
private final V source;
- public DefaultVisitAlgorithmsSelector( G graph, V source )
+ /**
+ * Create a default {@link VisitAlgorithmsSelector} for the given {@link Graph} and
+ * start {@link Vertex}.
+ *
+ * @param graph the {@link Graph} to be used.
+ * @param source the start {@link Vertex}.
+ */
+ public DefaultVisitAlgorithmsSelector( final G graph, final V source )
{
this.graph = graph;
this.source = source;
@@ -128,11 +137,11 @@ final class DefaultVisitAlgorithmsSelect
{
// if the vertex was already visited, do not discover
// another edge leading to the same vertex
- if ( visitedVertices.contains( v ) )
+ if ( visitedVertices.contains( v ) )
{
skipVertex = true;
- }
- else
+ }
+ else
{
if ( !handler.discoverEdge( prevHead, e, v ) )
{