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/07/13 16:10:19 UTC
svn commit: r1361226 - in
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph: flow/
model/
Author: marcosperanza
Date: Fri Jul 13 14:10:19 2012
New Revision: 1361226
URL: http://svn.apache.org/viewvc?rev=1361226&view=rev
Log:
Filled some javadocs, no functional modifications
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseMutableGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryWeightedPath.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java?rev=1361226&r1=1361225&r2=1361226&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java Fri Jul 13 14:10:19 2012
@@ -21,9 +21,21 @@ package org.apache.commons.graph.flow;
import org.apache.commons.graph.Mapper;
+/**
+ * TODO Fill Me!
+ *
+ * @param <V> the Graph vertices type
+ * @param <WE> the Graph edges type
+ */
public interface FlowWeightedEdgesBuilder<V, WE>
{
+ /**
+ * TODO Fill me!!
+ *
+ * @param weightedEdges
+ * @return
+ */
<W, M extends Mapper<WE, W>> FromHeadBuilder<V, WE, W> whereEdgesHaveWeights( M weightedEdges );
}
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java?rev=1361226&r1=1361225&r2=1361226&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java Fri Jul 13 14:10:19 2012
@@ -186,7 +186,8 @@ public abstract class BaseGraph<V, E>
}
/**
- * @return
+ * Return the edge {@link Set}
+ * @return the edge {@link Set}
*/
protected Set<E> getAllEdges()
{
@@ -194,7 +195,9 @@ public abstract class BaseGraph<V, E>
}
/**
- * @return the indexedEdges
+ * Returns the {@code Map} of indexed edges.
+ *
+ * @return the {@link Map} of indexed edges
*/
protected Map<VertexPair<V>, E> getIndexedEdges()
{
@@ -202,13 +205,31 @@ public abstract class BaseGraph<V, E>
}
/**
- * @return the indexedVertices
+ * Returns the {@code Map} of indexed vertices.
+ *
+ * @return the indexed vertices {@link Map}
*/
protected Map<E, VertexPair<V>> getIndexedVertices()
{
return indexedVertices;
}
+ /**
+ * Ensures the truth of an expression involving one or more parameters to the
+ * calling method.
+ *
+ * @param expression a boolean expression
+ * @param errorMessageTemplate a template for the exception message should the
+ * check fail. The message is formed by replacing each {@code %s}
+ * placeholder in the template with an argument. These are matched by
+ * position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc.
+ * Unmatched arguments will be appended to the formatted message in square
+ * braces. Unmatched placeholders will be left as-is.
+ * @param errorMessageArgs the arguments to be substituted into the message
+ * template. Arguments are converted to strings using
+ * {@link String#valueOf(Object)}.
+ * @throws GraphException if {@code expression} is false
+ */
protected static void checkGraphCondition( boolean expression, String errorMessageTemplate, Object...errorMessageArgs )
{
if ( !expression )
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseMutableGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseMutableGraph.java?rev=1361226&r1=1361225&r2=1361226&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseMutableGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseMutableGraph.java Fri Jul 13 14:10:19 2012
@@ -53,7 +53,8 @@ public abstract class BaseMutableGraph<V
}
/**
- * @param v
+ * Executes additional actions to vertex that will be added
+ * @param v the vertex
*/
protected abstract void decorateAddVertex( V v );
@@ -75,9 +76,8 @@ public abstract class BaseMutableGraph<V
}
/**
- *
- *
- * @param v
+ * Executes additional actions to vertex that will be removed
+ * @param v the vertex
*/
protected abstract void decorateRemoveVertex( V v );
@@ -100,6 +100,13 @@ public abstract class BaseMutableGraph<V
decorateAddEdge( head, e, tail );
}
+ /**
+ * Performs the internal operations to add the edge
+ *
+ * @param head the head vertex
+ * @param e the edge
+ * @param tail the tail vertex
+ */
protected void internalAddEdge( V head, E e, V tail )
{
getAdjacencyList().get( head ).add( tail );
@@ -113,6 +120,13 @@ public abstract class BaseMutableGraph<V
}
}
+ /**
+ * Performs the internal operations to remove the edge.
+ *
+ * @param head the head vertex
+ * @param e the edge
+ * @param tail the tail vertex
+ */
protected void internalRemoveEdge( V head, E e, V tail )
{
final VertexPair<V> vertexPair = new VertexPair<V>( head, tail );
@@ -122,7 +136,10 @@ public abstract class BaseMutableGraph<V
}
/**
- * @param e
+ * Executes additional actions to edge that will be added
+ * @param head the head vertex
+ * @param e the edge
+ * @param tail the tail vertex
*/
protected abstract void decorateAddEdge( V head, E e, V tail );
@@ -141,9 +158,8 @@ public abstract class BaseMutableGraph<V
}
/**
- *
- *
- * @param e
+ * Executes additional actions to edge that will be removed
+ * @param e the edge
*/
protected abstract void decorateRemoveEdge( E e );
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java?rev=1361226&r1=1361225&r2=1361226&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java Fri Jul 13 14:10:19 2012
@@ -62,6 +62,11 @@ public class InMemoryPath<V, E>
private final Map<E, VertexPair<V>> indexedVertices = new HashMap<E, VertexPair<V>>();
+ /**
+ * Creates a new instance of {@link InMemoryPath} from {@code start} vertex to {@code taget} vertex
+ * @param start the start vertex.
+ * @param target the target vertex.
+ */
public InMemoryPath( V start, V target )
{
this.source = checkNotNull( start, "Path source cannot be null" );
@@ -100,6 +105,13 @@ public class InMemoryPath<V, E>
return vertices.size();
}
+ /**
+ * Adds the edge in head.
+ *
+ * @param head the head vertex
+ * @param edge the edge
+ * @param tail the tail vertex
+ */
public void addConnectionInHead( V head, E edge, V tail )
{
if ( target.equals( tail ) )
@@ -113,6 +125,13 @@ public class InMemoryPath<V, E>
addConnection( head, edge, tail );
}
+ /**
+ * Adds the edge in tail.
+ *
+ * @param head the head vertex
+ * @param edge the edge
+ * @param tail the tail vertex
+ */
public void addConnectionInTail( V head, E edge, V tail )
{
vertices.addLast( head );
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryWeightedPath.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryWeightedPath.java?rev=1361226&r1=1361225&r2=1361226&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryWeightedPath.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryWeightedPath.java Fri Jul 13 14:10:19 2012
@@ -39,9 +39,6 @@ public final class InMemoryWeightedPath<
implements WeightedPath<V, WE, W>
{
- /**
- *
- */
private static final long serialVersionUID = 7937494144459068796L;
private final Monoid<W> weightOperations;
@@ -50,6 +47,14 @@ public final class InMemoryWeightedPath<
private W weight;
+ /**
+ * Creates a new instance of {@link InMemoryWeightedPath}.
+ *
+ * @param start the start vertex
+ * @param target the target vertex
+ * @param weightOperations
+ * @param weightedEdges
+ */
public InMemoryWeightedPath( V start, V target, Monoid<W> weightOperations, Mapper<WE, W> weightedEdges )
{
super( start, target );
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java?rev=1361226&r1=1361225&r2=1361226&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java Fri Jul 13 14:10:19 2012
@@ -45,6 +45,12 @@ public final class MutableSpanningTree<V
private W weight;
+ /**
+ * Creates a new instance of {@link MutableSpanningTree}
+ *
+ * @param weightOperations
+ * @param weightedEdges
+ */
public MutableSpanningTree( Monoid<W> weightOperations, Mapper<WE, W> weightedEdges )
{
this.weightOperations = weightOperations;