commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1134978 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph: WeightedGraph.java domain/basic/DirectedGraphImpl.java
Date Sun, 12 Jun 2011 20:39:24 GMT
Author: simonetripodi
Date: Sun Jun 12 20:39:24 2011
New Revision: 1134978

URL: http://svn.apache.org/viewvc?rev=1134978&view=rev
Log:
edge's weight is defined in the WeightedEdge itself, graph doesn't need to expose an API to
calculate it

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedGraph.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedGraph.java?rev=1134978&r1=1134977&r2=1134978&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedGraph.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedGraph.java
Sun Jun 12 20:39:24 2011
@@ -32,12 +32,4 @@ public interface WeightedGraph<V extends
     extends Graph<V, WE>
 {
 
-    /**
-     * Gets the weight attribute of the WeightedGraph object.
-     *
-     * @param e the {@link Edge} reference.
-     * @return the weight attribute of the WeightedGraph object.
-     */
-    Number getWeight( WE e );
-
 }

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java?rev=1134978&r1=1134977&r2=1134978&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/basic/DirectedGraphImpl.java
Sun Jun 12 20:39:24 2011
@@ -94,9 +94,7 @@ public class DirectedGraphImpl<V extends
 
             if ( dg instanceof WeightedGraph )
             {
-                @SuppressWarnings( "unchecked" ) // it is a DirectedGraph<V, WE>
-                WeightedGraph<V, WE> weightedGraph = (WeightedGraph<V, WE>) dg;
-                setWeight( edge, weightedGraph.getWeight( edge ) );
+                setWeight( edge, edge.getWeight() );
             }
         }
     }



Mime
View raw message