commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1298019 - in /commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph: ./ export/ shortestpath/
Date Wed, 07 Mar 2012 16:51:51 GMT
Author: simonetripodi
Date: Wed Mar  7 16:51:51 2012
New Revision: 1298019

URL: http://svn.apache.org/viewvc?rev=1298019&view=rev
Log:
no more WeightedGraph - still broken but going to the right direction

Modified:
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/CommonsGraph.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultHeuristicBuilder.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultShortestPathAlgorithmSelector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/HeuristicBuilder.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/ShortestPathAlgorithmSelector.java
    commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/CommonsGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/CommonsGraph.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/CommonsGraph.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/CommonsGraph.java
Wed Mar  7 16:51:51 2012
@@ -78,7 +78,7 @@ public final class CommonsGraph<V, E, G 
      * @param graph the input edge-weighted graph
      * @return
      */
-    public static <V, WE, W, G extends DirectedGraph<V, WE> & WeightedGraph<V,
WE, W>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )
+    public static <V, WE, W, G extends DirectedGraph<V, WE>> FromHeadBuilder<V,
WE, W, G> findMaxFlow( G graph )
     {
         graph = checkNotNull( graph, "Max flow can not be calculated on null graph" );
         return new DefaultFromHeadBuilder<V, WE, W, G>( graph );
@@ -89,7 +89,7 @@ public final class CommonsGraph<V, E, G 
      * @param graph
      * @return
      */
-    public static <V, WE, W, G extends WeightedGraph<V, WE, W>> SpanningTreeSourceSelector<V,
W, WE, G> minimumSpanningTree( G graph )
+    public static <V, WE, W, G extends Graph<V, WE> SpanningTreeSourceSelector<V,
W, WE, G> minimumSpanningTree( G graph )
     {
         graph = checkNotNull( graph, "Minimum spanning tree can not be calculated on null
graph" );
         return new DefaultSpanningTreeSourceSelector<V, W, WE, G>( graph );
@@ -104,7 +104,7 @@ public final class CommonsGraph<V, E, G 
      * @param <G>
      * @param graph
      */
-    public static <V, WE, W, G extends WeightedGraph<V, WE, W>> PathSourceSelector<V,
WE, W, G> findShortestPath( G graph )
+    public static <V, WE, W, G extends Graph<V, WE, W>> PathSourceSelector<V,
WE, W, G> findShortestPath( G graph )
     {
         graph = checkNotNull( graph, "Minimum spanning tree can not be calculated on null
graph" );
         return new DefaultPathSourceSelector<V, WE, W, G>( graph );

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java
Wed Mar  7 16:51:51 2012
@@ -69,9 +69,7 @@ final class DotExporter<V, E, G extends 
 
         for ( V vertex : getGraph().getVertices() )
         {
-            printWriter.format( "  %s [label=\"%s\"];%n",
-                                vertex.hashCode(),
-                                ( vertex instanceof Labeled) ? ( (Labeled) vertex).getLabel()
: vertex.toString() );
+            printWriter.format( "  %s [label=\"%s\"];%n", vertex.hashCode(), vertex.toString()
);
         }
 
         for ( E edge : getGraph().getEdges() )

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultHeuristicBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultHeuristicBuilder.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultHeuristicBuilder.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultHeuristicBuilder.java
Wed Mar  7 16:51:51 2012
@@ -26,11 +26,12 @@ import java.util.Queue;
 import java.util.Set;
 
 import org.apache.commons.graph.DirectedGraph;
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.WeightedPath;
 import org.apache.commons.graph.collections.FibonacciHeap;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
-final class DefaultHeuristicBuilder<V, WE, W, G extends WeightedGraph<V, WE, W>,
WO extends OrderedMonoid<W>>
+final class DefaultHeuristicBuilder<V, WE, W, G extends Graph<V, WE>, WO extends
OrderedMonoid<W>>
     implements HeuristicBuilder<V, WE, W, G, WO>
 {
 

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultPathSourceSelector.java
Wed Mar  7 16:51:51 2012
@@ -24,12 +24,13 @@ import static org.apache.commons.graph.u
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.UndirectedGraph;
 import org.apache.commons.graph.VertexPair;
 import org.apache.commons.graph.WeightedPath;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
-public final class DefaultPathSourceSelector<V, WE, W, G extends WeightedGraph<V, WE,
W>>
+public final class DefaultPathSourceSelector<V, WE, W, G extends Graph<V, WE>>
     implements PathSourceSelector<V, WE, W, G>
 {
 
@@ -115,7 +116,7 @@ public final class DefaultPathSourceSele
                                      V source, V target,
                                      Map<VertexPair<V>, V> next )
     {
-        V k = next.get( new VertexPair<Vertex>( source, target ) );
+        V k = next.get( new VertexPair<V>( source, target ) );
         if ( k == null )
         {
             // there is a direct path between a and b

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultShortestPathAlgorithmSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultShortestPathAlgorithmSelector.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultShortestPathAlgorithmSelector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultShortestPathAlgorithmSelector.java
Wed Mar  7 16:51:51 2012
@@ -25,11 +25,12 @@ import java.util.HashSet;
 import java.util.Queue;
 import java.util.Set;
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.WeightedPath;
 import org.apache.commons.graph.collections.FibonacciHeap;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
-final class DefaultShortestPathAlgorithmSelector<V, WE, W, G extends WeightedGraph<V,
WE, W>>
+final class DefaultShortestPathAlgorithmSelector<V, WE, W, G extends Graph<V, WE>>
     implements ShortestPathAlgorithmSelector<V, WE, W, G>
 {
 

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
Wed Mar  7 16:51:51 2012
@@ -21,11 +21,12 @@ package org.apache.commons.graph.shortes
 
 import static org.apache.commons.graph.utils.Assertions.checkNotNull;
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.VertexPair;
 import org.apache.commons.graph.WeightedPath;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
-final class DefaultTargetSourceSelector<V, WE, W, G extends WeightedGraph<V, WE, W>>
+final class DefaultTargetSourceSelector<V, WE, W, G extends Graph<V, WE>>
     implements TargetSourceSelector<V, WE, W, G>
 {
 

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/HeuristicBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/HeuristicBuilder.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/HeuristicBuilder.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/HeuristicBuilder.java
Wed Mar  7 16:51:51 2012
@@ -19,6 +19,7 @@ package org.apache.commons.graph.shortes
  * under the License.
  */
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.WeightedPath;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
@@ -29,7 +30,7 @@ import org.apache.commons.graph.weight.O
  * @param <W>
  * @param <G>
  */
-public interface HeuristicBuilder<V, WE, W, G extends WeightedGraph<V, WE, W>, WO
extends OrderedMonoid<W>>
+public interface HeuristicBuilder<V, WE, W, G extends Graph<V, WE>, WO extends OrderedMonoid<W>>
 {
 
     /**

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/PathSourceSelector.java
Wed Mar  7 16:51:51 2012
@@ -19,6 +19,7 @@ package org.apache.commons.graph.shortes
  * under the License.
  */
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
 /**
@@ -29,7 +30,7 @@ import org.apache.commons.graph.weight.O
  * @param <WE>
  * @param <G>
  */
-public interface PathSourceSelector<V, WE, W, G extends WeightedGraph<V, WE, W>>
+public interface PathSourceSelector<V, WE, W, G extends Graph<V, WE>>
 {
 
     /**

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/ShortestPathAlgorithmSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/ShortestPathAlgorithmSelector.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/ShortestPathAlgorithmSelector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/ShortestPathAlgorithmSelector.java
Wed Mar  7 16:51:51 2012
@@ -19,6 +19,7 @@ package org.apache.commons.graph.shortes
  * under the License.
  */
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.WeightedPath;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
@@ -30,7 +31,7 @@ import org.apache.commons.graph.weight.O
  * @param <WE>
  * @param <G>
  */
-public interface ShortestPathAlgorithmSelector<V, WE, W, G extends WeightedGraph<V,
WE, W>>
+public interface ShortestPathAlgorithmSelector<V, WE, W, G extends Graph<V, WE>>
 {
 
     /**

Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java?rev=1298019&r1=1298018&r2=1298019&view=diff
==============================================================================
--- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java
(original)
+++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/shortestpath/TargetSourceSelector.java
Wed Mar  7 16:51:51 2012
@@ -19,6 +19,7 @@ package org.apache.commons.graph.shortes
  * under the License.
  */
 
+import org.apache.commons.graph.Graph;
 import org.apache.commons.graph.weight.OrderedMonoid;
 
 /**
@@ -29,7 +30,7 @@ import org.apache.commons.graph.weight.O
  * @param <WE>
  * @param <G>
  */
-public interface TargetSourceSelector<V, WE, W, G extends WeightedGraph<V, WE, W>>
+public interface TargetSourceSelector<V, WE, W, G extends Graph<V, WE>>
 {
 
     /**



Mime
View raw message