```@@ -79,21 +79,21 @@ final class DefaultSpanningTreeAlgorithm
*     end while
*           */
-        checkNotNull( orderedMonoid, "The Boruvka algorithm can't be calulated with a null monoid" );
+        checkNotNull( weightOperations, "The Boruvka algorithm cannot be calculated with null weight operations" );
final MutableSpanningTree spanningTree =
-            new MutableSpanningTree( orderedMonoid );
+            new MutableSpanningTree( weightOperations );

-        final Set> components =
-            new HashSet>( graph.getOrder() );
+        final Set> components =
+            new HashSet>( graph.getOrder() );

-        final Map> mapping =
-            new HashMap>( graph.getOrder() );
+        final Map> mapping =
+            new HashMap>( graph.getOrder() );

for ( V v : graph.getVertices() )
{
// create a super vertex for each vertex
-            final SuperVertex sv =
-                new SuperVertex( v, graph, orderedMonoid );
+            final SuperVertex sv =
+                new SuperVertex( v, graph, weightOperations );
// add a mapping for each vertex to its corresponding super vertex
mapping.put( v, sv );
@@ -104,7 +104,7 @@ final class DefaultSpanningTreeAlgorithm
while ( components.size() > 1 )
{
-            for ( SuperVertex v : components )
+            for ( SuperVertex v : components )
{
// get the minimum edge for each component to any other component
WE edge = v.getMinimumWeightEdge();
@@ -125,8 +125,8 @@ final class DefaultSpanningTreeAlgorithm
V tail = pair.getTail();

// find the super vertices corresponding to this edge
-                SuperVertex tailSuper = mapping.get( tail );
+                SuperVertex tailSuper = mapping.get( tail );

// merge them, if they are not the same
if ( headSuper != tailSuper )
@@ -157,14 +157,14 @@ final class DefaultSpanningTreeAlgorithm
/**
* {@inheritDoc}
*/
-    public > SpanningTree applyingKruskalAlgorithm( OM orderedMonoid )
+    public > SpanningTree applyingKruskalAlgorithm( WO weightOperations )
{

-        checkNotNull( orderedMonoid, "The Kruskal algorithm can't be calulated with a null monoid" );
+        checkNotNull( weightOperations, "The Kruskal algorithm cannot be calculated with null weight operations" );
final Set settledNodes = new HashSet();

final PriorityQueue orderedEdges =
-            new PriorityQueue( graph.getSize(), new WeightedEdgesComparator( orderedMonoid ) );
+            new PriorityQueue( graph.getSize(), new WeightedEdgesComparator( weightOperations ) );

for ( WE edge : graph.getEdges() )
{
@@ -173,7 +173,7 @@ final class DefaultSpanningTreeAlgorithm

final DisjointSet disjointSet = new DisjointSet();

-        final MutableSpanningTree spanningTree = new MutableSpanningTree( orderedMonoid );
+        final MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations );

// fill the spanning tree with vertices.
for ( V v : graph.getVertices() )
@@ -204,11 +204,11 @@ final class DefaultSpanningTreeAlgorithm
/**
* {@inheritDoc}
*/
-    public > SpanningTree applyingPrimAlgorithm( OM orderedMonoid )
+    public > SpanningTree applyingPrimAlgorithm( WO weightOperations )
{
-        checkNotNull( orderedMonoid, "The Prim algorithm can't be calulated with a null monoid" );
+        checkNotNull( weightOperations, "The Prim algorithm cannot be calculated with null weight operations" );

-        final ShortestEdges shortestEdges = new ShortestEdges( graph, source, orderedMonoid );
+        final ShortestEdges shortestEdges = new ShortestEdges( graph, source, weightOperations );

final PriorityQueue unsettledNodes = new PriorityQueue( graph.getOrder(), shortestEdges );
@@ -227,7 +227,7 @@ final class DefaultSpanningTreeAlgorithm
// if the edge has not been already visited and its weight is
// less then the current Vertex weight
boolean weightLessThanCurrent = !shortestEdges.hasWeight( v )
-                        || orderedMonoid.compare( edge.getWeight(), shortestEdges.getWeight( v ) ) < 0;
+                        || weightOperations.compare( edge.getWeight(), shortestEdges.getWeight( v ) ) < 0;
if ( settledEdges.add( edge ) && weightLessThanCurrent )
{
if ( !unsettledNodes.contains( v ) )

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java Wed Feb 22 13:21:03 2012
@@ -80,10 +80,10 @@ public final class DefaultSpanningTreeSo
/**
* {@inheritDoc}
*/
-    public > SpanningTree applyingReverseDeleteAlgorithm( OM orderedMonoid )
+    public > SpanningTree applyingReverseDeleteAlgorithm( WO weightOperations )
{

-        checkNotNull( orderedMonoid, "The Reverse-Delete algorithm can't be calulated with a null monoid" );
+        checkNotNull( weightOperations, "The Reverse-Delete algorithm cannot be calulated with null weight operations" );

final List sortedEdge = new ArrayList();
final List visitedEdge = new ArrayList();
@@ -94,7 +94,7 @@ public final class DefaultSpanningTreeSo
}

-        sort( sortedEdge, reverseOrder( new WeightedEdgesComparator( orderedMonoid ) ) );
+        sort( sortedEdge, reverseOrder( new WeightedEdgesComparator( weightOperations ) ) );

WeightedGraph tmpGraph = new ReverseDeleteGraph( graph, sortedEdge, visitedEdge );

@@ -107,7 +107,7 @@ public final class DefaultSpanningTreeSo

try
{
-                findShortestPath( tmpGraph ).from( vertices.getHead() ).to( vertices.getTail() ).applyingDijkstra( orderedMonoid );
+                findShortestPath( tmpGraph ).from( vertices.getHead() ).to( vertices.getTail() ).applyingDijkstra( weightOperations );
}
catch ( PathNotFoundException ex )
{
@@ -116,7 +116,7 @@ public final class DefaultSpanningTreeSo
}
}

-        final MutableSpanningTree res = new MutableSpanningTree( orderedMonoid );
+        final MutableSpanningTree res = new MutableSpanningTree( weightOperations );
for ( V v : graph.getVertices() )
{

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java Wed Feb 22 13:21:03 2012
@@ -47,17 +47,17 @@ final class ShortestEdges predecessors = new HashMap();

-    private final OrderedMonoid orderedMonoid;
+    private final OrderedMonoid weightOperations;

private final Graph graph;

private final V source;

-    public ShortestEdges(Graph graph, V source, OrderedMonoid orderedMonoid )
+    public ShortestEdges(Graph graph, V source, OrderedMonoid weightOperations )
{
this.graph = graph;
this.source = source;
-        this.orderedMonoid = orderedMonoid;
+        this.weightOperations = weightOperations;
}

/**
@@ -78,7 +78,7 @@ final class ShortestEdges createSpanningTree()
{
-        MutableSpanningTree spanningTree = new MutableSpanningTree( orderedMonoid );
+        MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations );

for ( WE edge : this.predecessors.values() )
{
@@ -132,7 +132,7 @@ final class ShortestEdgesBoruvka's algorithm.
*
-     * @param orderedMonoid the graph weights monoid
+     * @param  the type of weight operations
+     * @param weightOperations the class responsible for operations on weights
* @return the calculated spanning tree
*/
-    > SpanningTree applyingBoruvkaAlgorithm( OM orderedMonoid );
+    > SpanningTree applyingBoruvkaAlgorithm( WO weightOperations );

/**
* Applies the Kruskal's algorithm.
*
-     * @param orderedMonoid the graph weights monoid
+     * @param  the type of weight operations
+     * @param weightOperations the class responsible for operations on weights
* @return the calculated spanning tree
*/
-    > SpanningTree applyingKruskalAlgorithm( OM orderedMonoid );
+    > SpanningTree applyingKruskalAlgorithm( WO weightOperations );

/**
* Applies the Prim's algorithm.
*
-     * @param orderedMonoid the graph weights monoid
+     * @param  the type of weight operations
+     * @param weightOperations the class responsible for operations on weights
* @return the calculated spanning tree
*/
-    > SpanningTree applyingPrimAlgorithm( OM orderedMonoid );
+    > SpanningTree applyingPrimAlgorithm( WO weightOperations );

}

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SpanningTreeSourceSelector.java Wed Feb 22 13:21:03 2012
@@ -67,9 +67,9 @@ public interface SpanningTreeSourceSelec
*   return edges[] E
*
*
-     * @param orderedMonoid the graph weights monoid
+     * @param weightOperations the weight operations
* @return the calculated spanning tree
*/
-    > SpanningTree applyingReverseDeleteAlgorithm( OM orderedMonoid );
+    > SpanningTree applyingReverseDeleteAlgorithm( WO weightOperations );

}

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/SuperVertex.java Wed Feb 22 13:21:03 2012
@@ -19,6 +19,7 @@ package org.apache.commons.graph.spannin
*/

+import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -28,7 +29,6 @@ import org.apache.commons.graph.Graph;
import org.apache.commons.graph.Vertex;
import org.apache.commons.graph.VertexPair;
import org.apache.commons.graph.WeightedEdge;
-import org.apache.commons.graph.weight.OrderedMonoid;

/**
* A {@link SuperVertex} is a collection of {@link Vertex} objects and is only
@@ -38,9 +38,9 @@ import org.apache.commons.graph.weight.O
* @param   the weight type
* @param  the Graph weighted edges type
* @param   the input Graph type
- * @param  the Comparator for weighted edges
+ * @param  the weight operations
*/
-class SuperVertex, G extends Graph, OM extends OrderedMonoid>
+class SuperVertex, G extends Graph, WC extends Comparator>
implements Iterable {

/** The reference to the graph. */
@@ -58,15 +58,15 @@ class SuperVertex();

-        orderedEdges = new TreeSet( new WeightedEdgesComparator( orderedMonoid ) );
+        orderedEdges = new TreeSet( new WeightedEdgesComparator( weightComparator ) );

// add all edges for this vertex to the sorted set
for ( V w : graph.getConnectedVertices( source )) {
@@ -87,7 +87,7 @@ class SuperVertex other ) {
+    public void merge( final SuperVertex other ) {
for ( V v : other.vertices ) {
}

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/WeightedEdgesComparator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/WeightedEdgesComparator.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/WeightedEdgesComparator.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/WeightedEdgesComparator.java Wed Feb 22 13:21:03 2012
@@ -20,7 +20,6 @@ package org.apache.commons.graph.spannin
*/

import org.apache.commons.graph.WeightedEdge;
-import org.apache.commons.graph.weight.OrderedMonoid;

import java.util.Comparator;

@@ -33,16 +32,16 @@ public class WeightedEdgesComparator
{

-    private final OrderedMonoid orderedMonoid;
+    private final Comparator weightComparator;

-    public WeightedEdgesComparator( OrderedMonoid orderedMonoid )
+    public WeightedEdgesComparator( Comparator weightComparator )
{
-        this.orderedMonoid = orderedMonoid;
+        this.weightComparator = weightComparator;
}

public int compare( WE o1, WE o2 )
{
-        return orderedMonoid.compare( o1.getWeight(), o2.getWeight() );
+        return weightComparator.compare( o1.getWeight(), o2.getWeight() );
}

}

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeightBaseOperations.java (from r1290988, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeight.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeightBaseOperations.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeightBaseOperations.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeight.java&r1=1290988&r2=1292272&rev=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeight.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigDecimalWeightBaseOperations.java Wed Feb 22 13:21:03 2012
@@ -26,10 +26,10 @@ import java.math.BigDecimal;
import org.apache.commons.graph.weight.OrderedMonoid;

/**
- * An {@link BigBigDecimalWeight} provides operations and properties
+ * The class {@link BigDecimalWeightBaseOperations} provides operations and properties
* for weights of type {@link BigDecimal}.
*/
-public class BigDecimalWeight
+public class BigDecimalWeightBaseOperations
implements OrderedMonoid
{

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeightBaseOperations.java (from r1290988, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeight.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeightBaseOperations.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeightBaseOperations.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeight.java&r1=1290988&r2=1292272&rev=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeight.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/BigIntegerWeightBaseOperations.java Wed Feb 22 13:21:03 2012
@@ -26,10 +26,10 @@ import java.math.BigInteger;
import org.apache.commons.graph.weight.OrderedMonoid;

/**
- * An {@link BigIntegerWeight} provides operations and properties
+ * The class {@link BigIntegerWeightBaseOperations} provides operations and properties
* for weights of type {@link BigInteger}.
*/
-public class BigIntegerWeight
+public class BigIntegerWeightBaseOperations
implements OrderedMonoid
{

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeightBaseOperations.java (from r1290988, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeight.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeightBaseOperations.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeightBaseOperations.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeight.java&r1=1290988&r2=1292272&rev=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeight.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/DoubleWeightBaseOperations.java Wed Feb 22 13:21:03 2012
@@ -22,10 +22,10 @@ package org.apache.commons.graph.weight.
import org.apache.commons.graph.weight.OrderedMonoid;

/**
- * A {@link DoubleWeight} provides operations and properties
+ * The class {@link DoubleWeightBaseOperations} provides operations and properties
* for weights of type {@link Double}.
*/
-public class DoubleWeight
+public class DoubleWeightBaseOperations
implements OrderedMonoid
{

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeightBaseOperations.java (from r1290988, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeight.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeightBaseOperations.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeightBaseOperations.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeight.java&r1=1290988&r2=1292272&rev=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeight.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/FloatWeightBaseOperations.java Wed Feb 22 13:21:03 2012
@@ -22,10 +22,10 @@ package org.apache.commons.graph.weight.
import org.apache.commons.graph.weight.OrderedMonoid;

/**
- * A {@link FloatWeight} provides operations and properties
+ * The class {@link FloatWeightBaseOperations} provides operations and properties
* for weights of type {@link Float}.
*/
-public class FloatWeight
+public class FloatWeightBaseOperations
implements OrderedMonoid
{

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeightBaseOperations.java (from r1290988, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeight.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeightBaseOperations.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeightBaseOperations.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeight.java&r1=1290988&r2=1292272&rev=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeight.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/IntegerWeightBaseOperations.java Wed Feb 22 13:21:03 2012
@@ -22,10 +22,10 @@ package org.apache.commons.graph.weight.
import org.apache.commons.graph.weight.OrderedMonoid;

/**
- * An {@link IntegerWeight} provides operations and properties
+ * The class {@link IntegerWeightBaseOperations} provides operations and properties
* for weights of type {@link Integer}.
*/
-public class IntegerWeight
+public class IntegerWeightBaseOperations
implements OrderedMonoid
{

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeightBaseOperations.java (from r1290988, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeight.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeightBaseOperations.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeightBaseOperations.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeight.java&r1=1290988&r2=1292272&rev=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeight.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/LongWeightBaseOperations.java Wed Feb 22 13:21:03 2012
@@ -22,10 +22,10 @@ package org.apache.commons.graph.weight.
import org.apache.commons.graph.weight.OrderedMonoid;

/**
- * A {@link LongWeight} provides operations and properties
+ * The class {@link LongWeightBaseOperations} provides operations and properties
* for weights of type {@link Long}.
*/
-public class LongWeight
+public class LongWeightBaseOperations
implements OrderedMonoid
{

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/package-info.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/package-info.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/weight/primitive/package-info.java Wed Feb 22 13:21:03 2012
@@ -1,5 +1,5 @@
/**
- * Primitive weight implementations.
+ * Implementations of base operations on primitive types of weights.
*/
package org.apache.commons.graph.weight.primitive;

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java Wed Feb 22 13:21:03 2012
@@ -29,7 +29,7 @@ import org.apache.commons.graph.builder.
import org.apache.commons.graph.model.BaseLabeledVertex;
import org.apache.commons.graph.model.BaseLabeledWeightedEdge;
import org.apache.commons.graph.model.DirectedMutableWeightedGraph;
-import org.apache.commons.graph.weight.primitive.IntegerWeight;
+import org.apache.commons.graph.weight.primitive.IntegerWeightBaseOperations;
import org.junit.Test;

/**
@@ -47,7 +47,7 @@ public class EdmondsKarpTestCase
final BaseLabeledVertex g = new BaseLabeledVertex( "G" );

// actual max flow
-        findMaxFlow( (DirectedMutableWeightedGraph, Integer>)  null ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
+        findMaxFlow( (DirectedMutableWeightedGraph, Integer>)  null ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeightBaseOperations() );
}

@Test( expected = NullPointerException.class )
@@ -68,7 +68,7 @@ public class EdmondsKarpTestCase
} );

// actual max flow
-        findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
+        findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeightBaseOperations() );
}

@Test
@@ -101,7 +101,7 @@ public class EdmondsKarpTestCase
final Integer expected = 0;

// actual max flow
-        Integer actual = findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
+        Integer actual = findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeightBaseOperations() );
assertEquals( actual, expected );
}

@@ -145,7 +145,7 @@ public class EdmondsKarpTestCase
final Integer expected = 5;

// actual max flow
-        Integer actual = findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
+        Integer actual = findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeightBaseOperations() );

assertEquals( actual, expected );
}

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java Wed Feb 22 13:21:03 2012
@@ -31,7 +31,7 @@ import org.apache.commons.graph.builder.
import org.apache.commons.graph.model.BaseLabeledVertex;
import org.apache.commons.graph.model.BaseLabeledWeightedEdge;
import org.apache.commons.graph.model.DirectedMutableWeightedGraph;
-import org.apache.commons.graph.weight.primitive.IntegerWeight;
+import org.apache.commons.graph.weight.primitive.IntegerWeightBaseOperations;
import org.junit.Test;

/**
@@ -48,13 +48,13 @@ public final class FordFulkersonTestCase
final BaseLabeledVertex a = new BaseLabeledVertex( "A" );
final BaseLabeledVertex d = new BaseLabeledVertex( "D" );

-        findMaxFlow( (DirectedMutableWeightedGraph, Integer>) null ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeight() );
+        findMaxFlow( (DirectedMutableWeightedGraph, Integer>) null ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeightBaseOperations() );
}

@Test(expected=NullPointerException.class)
public void testNullGraphAndVertices()
{
-        findMaxFlow( (DirectedMutableWeightedGraph, Integer>) null ).from( null ).to( null ).applyingFordFulkerson( new IntegerWeight() );
+        findMaxFlow( (DirectedMutableWeightedGraph, Integer>) null ).from( null ).to( null ).applyingFordFulkerson( new IntegerWeightBaseOperations() );
}

@Test
@@ -83,7 +83,7 @@ public final class FordFulkersonTestCase
final Integer expected = 0;

// actual max flow
-        Integer actual = findMaxFlow( graph ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeight() );
+        Integer actual = findMaxFlow( graph ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeightBaseOperations() );

assertEquals( actual, expected );
}
@@ -115,7 +115,7 @@ public final class FordFulkersonTestCase
final Integer expected = 0;

// actual max flow
-        Integer actual = findMaxFlow( graph ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeight() );
+        Integer actual = findMaxFlow( graph ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeightBaseOperations() );

assertEquals( actual, expected );
}
@@ -143,7 +143,7 @@ public final class FordFulkersonTestCase
}

// actual max flow
-        findMaxFlow( graph ).from( null ).to( null ).applyingFordFulkerson( new IntegerWeight() );
+        findMaxFlow( graph ).from( null ).to( null ).applyingFordFulkerson( new IntegerWeightBaseOperations() );
}

@Test
@@ -177,7 +177,7 @@ public final class FordFulkersonTestCase
final Integer expected = 2000;

// actual max flow
-        Integer actual = findMaxFlow( graph ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeight() );
+        Integer actual = findMaxFlow( graph ).from( a ).to( d ).applyingFordFulkerson( new IntegerWeightBaseOperations() );

assertEquals( actual, expected );
}

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java Wed Feb 22 13:21:03 2012
@@ -34,7 +34,7 @@ import org.apache.commons.graph.model.Ba
import org.apache.commons.graph.model.BaseLabeledWeightedEdge;
import org.apache.commons.graph.model.InMemoryWeightedPath;
import org.apache.commons.graph.model.UndirectedMutableWeightedGraph;
-import org.apache.commons.graph.weight.primitive.DoubleWeight;
+import org.apache.commons.graph.weight.primitive.DoubleWeightBaseOperations;
import org.junit.Test;

public final class AStarTestCase
@@ -43,7 +43,7 @@ public final class AStarTestCase
@Test( expected = NullPointerException.class )
public void testNullGraph()
{
-        findShortestPath( (WeightedGraph, Double>) null ).from( null ).to( null ).applyingAStar( new DoubleWeight() ).withHeuristic( null );
+        findShortestPath( (WeightedGraph, Double>) null ).from( null ).to( null ).applyingAStar( new DoubleWeightBaseOperations() ).withHeuristic( null );
}

@Test( expected = NullPointerException.class )
@@ -52,7 +52,7 @@ public final class AStarTestCase
UndirectedMutableWeightedGraph, Double> graph =
new UndirectedMutableWeightedGraph, Double>();

-        findShortestPath( graph ).from( null ).to( null ).applyingAStar( new DoubleWeight() ).withHeuristic( null );
+        findShortestPath( graph ).from( null ).to( null ).applyingAStar( new DoubleWeightBaseOperations() ).withHeuristic( null );
}

@Test( expected = NullPointerException.class )
@@ -61,7 +61,7 @@ public final class AStarTestCase
UndirectedMutableWeightedGraph, Double> graph =
new UndirectedMutableWeightedGraph, Double>();

-        findShortestPath( graph ).from( new BaseLabeledVertex( "a" ) ).to( new BaseLabeledVertex( "b" ) ).applyingAStar( new DoubleWeight() ).withHeuristic( null );
+        findShortestPath( graph ).from( new BaseLabeledVertex( "a" ) ).to( new BaseLabeledVertex( "b" ) ).applyingAStar( new DoubleWeightBaseOperations() ).withHeuristic( null );
}

@Test( expected = NullPointerException.class )
@@ -121,7 +121,7 @@ public final class AStarTestCase

};

-        findShortestPath( graph ).from( a ).to( b ).applyingAStar( new DoubleWeight() ).withHeuristic( heuristic );
+        findShortestPath( graph ).from( a ).to( b ).applyingAStar( new DoubleWeightBaseOperations() ).withHeuristic( heuristic );
}

/**
@@ -186,7 +186,7 @@ public final class AStarTestCase

InMemoryWeightedPath, Double> expected =
new InMemoryWeightedPath, Double>( start, goal,
-                                                                                                  new DoubleWeight() );
+                                                                                                  new DoubleWeightBaseOperations() );

expected.addConnectionInTail( start, new BaseLabeledWeightedEdge( "start <-> a", 1.5D ), a );
expected.addConnectionInTail( a, new BaseLabeledWeightedEdge( "a <-> b", 2D ), b );
@@ -196,7 +196,7 @@ public final class AStarTestCase
// actual path

Path> actual =
-            findShortestPath( graph ).from( start ).to( goal ).applyingAStar( new DoubleWeight() ).withHeuristic( heuristic );
+            findShortestPath( graph ).from( start ).to( goal ).applyingAStar( new DoubleWeightBaseOperations() ).withHeuristic( heuristic );

// assert!

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java?rev=1292272&r1=1292271&r2=1292272&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java Wed Feb 22 13:21:03 2012
@@ -32,7 +32,7 @@ import org.apache.commons.graph.model.Ba
import org.apache.commons.graph.model.DirectedMutableWeightedGraph;
import org.apache.commons.graph.model.InMemoryWeightedPath;
import org.apache.commons.graph.model.UndirectedMutableWeightedGraph;
-import org.apache.commons.graph.weight.primitive.DoubleWeight;
+import org.apache.commons.graph.weight.primitive.DoubleWeightBaseOperations;
import org.junit.Test;

public final class BellmannFordTestCase
@@ -42,7 +42,7 @@ public final class BellmannFordTestCase
public void testNullGraph()
{
// the actual weighted path
-        findShortestPath( (WeightedGraph, Double>) null ).from( null ).applyingBelmannFord( new DoubleWeight() );
+        findShortestPath( (WeightedGraph, Double>) null ).from( null ).applyingBelmannFord( new DoubleWeightBaseOperations() );
}

@Test( expected = NullPointerException.class )
@@ -51,7 +51,7 @@ public final class BellmannFordTestCase
UndirectedMutableWeightedGraph, Double> graph =
new UndirectedMutableWeightedGraph, Double>();

-        findShortestPath( graph ).from( null ).applyingBelmannFord( new DoubleWeight() );
+        findShortestPath( graph ).from( null ).applyingBelmannFord( new DoubleWeightBaseOperations() );
}

@Test( expected = NullPointerException.class )
@@ -95,7 +95,7 @@ public final class BellmannFordTestCase

-            allVertexPairsShortestPath = findShortestPath( graph ).from( a ).applyingBelmannFord( new DoubleWeight() );
+            allVertexPairsShortestPath = findShortestPath( graph ).from( a ).applyingBelmannFord( new DoubleWeightBaseOperations() );
}
catch ( PathNotFoundException e )
{
@@ -144,13 +144,13 @@ public final class BellmannFordTestCase

// the expected weighted path
InMemoryWeightedPath, Double> expected =
-            new InMemoryWeightedPath, Double>( one, three, new DoubleWeight() );
+            new InMemoryWeightedPath, Double>( one, three, new DoubleWeightBaseOperations() );
expected.addConnectionInTail( one, new BaseLabeledWeightedEdge( "1 -> 4", 7D ), four );
expected.addConnectionInTail( four, new BaseLabeledWeightedEdge( "4 -> 3", -3D ), three );

// the actual weighted path