You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2012/04/22 22:21:26 UTC
svn commit: r1328966 - in
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph: ./
collections/ coloring/ connectivity/
Author: marcosperanza
Date: Sun Apr 22 20:21:25 2012
New Revision: 1328966
URL: http://svn.apache.org/viewvc?rev=1328966&view=rev
Log:
Fixed checkstyle warnigs
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Graph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Mapper.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedDirectedGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedMutableGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedUndirectedGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSet.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoredVertices.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoringAlgorithmsSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColorsBuilder.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/DefaultColoringAlgorithmsSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/ConnectivityAlgorithmsSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityAlgorithmsSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Graph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Graph.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Graph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Graph.java Sun Apr 22 20:21:25 2012
@@ -1,7 +1,5 @@
package org.apache.commons.graph;
-import java.io.Serializable;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,6 +19,8 @@ import java.io.Serializable;
* under the License.
*/
+import java.io.Serializable;
+
/**
* A Graph data structure consists of a finite (and possibly mutable) set of ordered pairs, called {@link Edge}s or
* arcs, of certain entities called {@link Vertex} or node. As in mathematics, an {@link Edge} {@code (x,y)} is said to
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Mapper.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Mapper.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Mapper.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/Mapper.java Sun Apr 22 20:21:25 2012
@@ -1,7 +1,5 @@
package org.apache.commons.graph;
-import java.io.Serializable;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,6 +19,8 @@ import java.io.Serializable;
* under the License.
*/
+import java.io.Serializable;
+
public interface Mapper<I, O>
extends Serializable
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedDirectedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedDirectedGraph.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedDirectedGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedDirectedGraph.java Sun Apr 22 20:21:25 2012
@@ -20,7 +20,7 @@ package org.apache.commons.graph;
*/
/**
- *
+ * A synchronized (thread-safe) {@link Graph} backed by the specified Graph.
*/
class SynchronizedDirectedGraph<V, E>
extends SynchronizedGraph<V, E>
@@ -29,10 +29,11 @@ class SynchronizedDirectedGraph<V, E>
private static final long serialVersionUID = 2275587906693672253L;
- final private DirectedGraph<V, E> directedGraph;
+ private final DirectedGraph<V, E> directedGraph;
/**
- * @param g
+ * Creates a new thread-safe instence of {@link SynchronizedDirectedGraph}.
+ * @param g The {@link Graph} that has to be synchronized
*/
public SynchronizedDirectedGraph( DirectedGraph<V, E> g )
{
@@ -40,6 +41,9 @@ class SynchronizedDirectedGraph<V, E>
directedGraph = g;
}
+ /**
+ * {@inheritDoc}
+ */
public int getInDegree( V v )
{
synchronized ( lock )
@@ -48,6 +52,9 @@ class SynchronizedDirectedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public Iterable<V> getInbound( V v )
{
synchronized ( lock )
@@ -56,6 +63,9 @@ class SynchronizedDirectedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public int getOutDegree( V v )
{
synchronized ( lock )
@@ -64,6 +74,9 @@ class SynchronizedDirectedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public Iterable<V> getOutbound( V v )
{
synchronized ( lock )
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedGraph.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedGraph.java Sun Apr 22 20:21:25 2012
@@ -1,7 +1,5 @@
package org.apache.commons.graph;
-import static org.apache.commons.graph.utils.Objects.eq;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,8 +19,10 @@ import static org.apache.commons.graph.u
* under the License.
*/
+import static org.apache.commons.graph.utils.Objects.eq;
+
/**
- *
+ * A synchronized (thread-safe) {@link Graph} backed by the specified Graph.
*/
class SynchronizedGraph<V, E>
implements Graph<V, E>
@@ -30,12 +30,13 @@ class SynchronizedGraph<V, E>
private static final long serialVersionUID = 4472623111635514693L;
- final protected Object lock;
+ protected final Object lock;
- final protected Graph<V, E> g;
+ protected final Graph<V, E> g;
/**
- *
+ * Creates a new thread-safe instence of {@link SynchronizedGraph}.
+ * @param g The {@link Graph} that has to be synchronized
*/
public SynchronizedGraph( Graph<V, E> g )
{
@@ -43,6 +44,9 @@ class SynchronizedGraph<V, E>
this.lock = this;
}
+ /**
+ * {@inheritDoc}
+ */
public Iterable<V> getVertices()
{
synchronized ( lock )
@@ -51,6 +55,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public int getOrder()
{
synchronized ( lock )
@@ -59,6 +66,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public Iterable<E> getEdges()
{
synchronized ( lock )
@@ -67,6 +77,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public int getSize()
{
synchronized ( lock )
@@ -75,6 +88,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public int getDegree( V v )
{
synchronized ( lock )
@@ -83,6 +99,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public Iterable<V> getConnectedVertices( V v )
{
synchronized ( lock )
@@ -91,6 +110,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public E getEdge( V source, V target )
{
synchronized ( lock )
@@ -99,6 +121,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public VertexPair<V> getVertices( E e )
{
synchronized ( lock )
@@ -107,6 +132,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public boolean containsVertex( V v )
{
synchronized ( lock )
@@ -115,6 +143,9 @@ class SynchronizedGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public boolean containsEdge( E e )
{
synchronized ( lock )
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedMutableGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedMutableGraph.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedMutableGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedMutableGraph.java Sun Apr 22 20:21:25 2012
@@ -20,7 +20,7 @@ package org.apache.commons.graph;
*/
/**
- *
+ * A synchronized (thread-safe) {@link Graph} backed by the specified Graph.
*/
class SynchronizedMutableGraph<V, E>
extends SynchronizedGraph<V, E>
@@ -28,14 +28,21 @@ class SynchronizedMutableGraph<V, E>
{
private static final long serialVersionUID = -5985121601939852063L;
- private MutableGraph<V, E> mutableGraph;
+ private final MutableGraph<V, E> mutableGraph;
+ /**
+ * Creates a new thread-safe instence of {@link SynchronizedMutableGraph}.
+ * @param g The {@link Graph} that has to be synchronized
+ */
public SynchronizedMutableGraph( MutableGraph<V, E> g )
{
super( g );
this.mutableGraph = g;
}
+ /**
+ * {@inheritDoc}
+ */
public void addVertex( V v )
{
synchronized ( lock )
@@ -43,7 +50,10 @@ class SynchronizedMutableGraph<V, E>
mutableGraph.addVertex( v );
}
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public void removeVertex( V v )
{
synchronized ( lock )
@@ -52,6 +62,9 @@ class SynchronizedMutableGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public void addEdge( V head, E e, V tail )
{
synchronized ( lock )
@@ -60,6 +73,9 @@ class SynchronizedMutableGraph<V, E>
}
}
+ /**
+ * {@inheritDoc}
+ */
public void removeEdge( E e )
{
synchronized ( lock )
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedUndirectedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedUndirectedGraph.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedUndirectedGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/SynchronizedUndirectedGraph.java Sun Apr 22 20:21:25 2012
@@ -20,7 +20,7 @@ package org.apache.commons.graph;
*/
/**
- *
+ * A synchronized (thread-safe) {@link Graph} backed by the specified Graph.
*/
class SynchronizedUndirectedGraph<V, E>
extends SynchronizedGraph<V, E>
@@ -30,7 +30,8 @@ class SynchronizedUndirectedGraph<V, E>
private static final long serialVersionUID = 2207884889346410427L;
/**
- * @param g
+ * Creates a new thread-safe instence of {@link SynchronizedUndirectedGraph}.
+ * @param g The {@link Graph} that has to be synchronized
*/
public SynchronizedUndirectedGraph( Graph<V, E> g )
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedPath.java Sun Apr 22 20:21:25 2012
@@ -23,7 +23,7 @@ package org.apache.commons.graph;
* A {@code Path} whose {@link Edge}s are {@link Weighted}.
*
* @param <V> the Graph vertices type
- * @param <WE> the Graph weighted edges type
+ * @param <E> the Graph weighted edges type
* @param <W> the weight type
*/
public interface WeightedPath<V, E, W>
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSet.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSet.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSet.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSet.java Sun Apr 22 20:21:25 2012
@@ -55,6 +55,7 @@ public final class DisjointSet<E>
/**
* Performs the find applying the <i>path compression</i>.
*
+ * @param <E> the type of elements held in this collection.
* @param node
* @return
*/
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java Sun Apr 22 20:21:25 2012
@@ -76,7 +76,7 @@ public final class FibonacciHeap<E>
public FibonacciHeap()
{
- this(null);
+ this( null );
}
public FibonacciHeap( /* @Nullable */Comparator<? super E> comparator )
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoredVertices.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoredVertices.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoredVertices.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoredVertices.java Sun Apr 22 20:21:25 2012
@@ -105,6 +105,9 @@ public final class ColoredVertices<V, C>
/**
* Tests if the 'vertex' is colored.
+ *
+ * @param vertex the vertex
+ * @return true if the colored vertex is contained into the map, false otherwise
*/
public boolean containsColoredVertex( V vertex )
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoringAlgorithmsSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoringAlgorithmsSelector.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoringAlgorithmsSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColoringAlgorithmsSelector.java Sun Apr 22 20:21:25 2012
@@ -25,7 +25,6 @@ package org.apache.commons.graph.colorin
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
- * @param <G> the Graph type
* @param <C> the Color vertices type
*/
public interface ColoringAlgorithmsSelector<V, E, C>
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColorsBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColorsBuilder.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColorsBuilder.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/ColorsBuilder.java Sun Apr 22 20:21:25 2012
@@ -26,7 +26,6 @@ import java.util.Set;
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
- * @param <G> the Graph type
*/
public interface ColorsBuilder<V, E>
{
@@ -34,6 +33,7 @@ public interface ColorsBuilder<V, E>
/**
* Specifies the set of colors for coloring the graph.
*
+ * @param <C> the Color type.
* @param colors the set of colors for coloring the graph.
* @return the coloring algorithm selector.
*/
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/DefaultColoringAlgorithmsSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/DefaultColoringAlgorithmsSelector.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/DefaultColoringAlgorithmsSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/coloring/DefaultColoringAlgorithmsSelector.java Sun Apr 22 20:21:25 2012
@@ -33,7 +33,6 @@ import org.apache.commons.graph.Undirect
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
- * @param <G> the Graph type
* @param <C> the Color vertices type
*/
final class DefaultColoringAlgorithmsSelector<V, E, C>
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/ConnectivityAlgorithmsSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/ConnectivityAlgorithmsSelector.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/ConnectivityAlgorithmsSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/ConnectivityAlgorithmsSelector.java Sun Apr 22 20:21:25 2012
@@ -26,7 +26,6 @@ import java.util.List;
* Builder for selecting the connectivity algorithm to perform.
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
- * @param <G> the Graph type
*/
public interface ConnectivityAlgorithmsSelector<V, E>
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityAlgorithmsSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityAlgorithmsSelector.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityAlgorithmsSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityAlgorithmsSelector.java Sun Apr 22 20:21:25 2012
@@ -30,15 +30,16 @@ import java.util.List;
import org.apache.commons.graph.Graph;
/**
- *
+ * @param <V> the Graph vertices type
+ * @param <E> the Graph edges type
*/
final class DefaultConnectivityAlgorithmsSelector<V, E>
implements ConnectivityAlgorithmsSelector<V, E>
{
- final private Graph<V, E> graph;
+ private final Graph<V, E> graph;
- final private Iterable<V> includedVertices;
+ private final Iterable<V> includedVertices;
public DefaultConnectivityAlgorithmsSelector( Graph<V, E> graph, Iterable<V> includedVertices )
{
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java?rev=1328966&r1=1328965&r2=1328966&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectivity/DefaultConnectivityBuilder.java Sun Apr 22 20:21:25 2012
@@ -25,7 +25,8 @@ import static org.apache.commons.graph.u
import org.apache.commons.graph.Graph;
/**
- *
+ * @param <V> the Graph vertices type
+ * @param <E> the Graph edges type
*/
public class DefaultConnectivityBuilder<V, E>
implements ConnectivityBuilder<V, E>