You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/06/14 18:21:55 UTC
svn commit: r1135678 -
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
Author: simonetripodi
Date: Tue Jun 14 16:21:55 2011
New Revision: 1135678
URL: http://svn.apache.org/viewvc?rev=1135678&view=rev
Log:
fixed compilation problems
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java?rev=1135678&r1=1135677&r2=1135678&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java Tue Jun 14 16:21:55 2011
@@ -39,7 +39,7 @@ import org.apache.commons.graph.domain.b
/**
* Description of the Class
*/
-public class DecoratedDirectedGraph<V extends Vertex, WE extends WeightedEdge>
+public class DecoratedDirectedGraph<V extends Vertex, WE extends WeightedEdge<V>>
extends DirectedGraphWrapper<V, WE>
implements DirectedGraph<V, WE>, WeightedGraph<V, WE>
{
@@ -50,7 +50,7 @@ public class DecoratedDirectedGraph<V ex
/**
* Description of the Method
*/
- public static <V extends Vertex, WE extends WeightedEdge> DecoratedDirectedGraph<V, WE> decorateGraph( DirectedGraph<V, WE> graph )
+ public static <V extends Vertex, WE extends WeightedEdge<V>> DecoratedDirectedGraph<V, WE> decorateGraph( DirectedGraph<V, WE> graph )
{
if ( graph instanceof DecoratedDirectedGraph )
{
@@ -97,35 +97,6 @@ public class DecoratedDirectedGraph<V ex
}
// WeightedGraph Implementation
- /**
- * Gets the weight attribute of the DDirectedGraph object
- */
- public Number getWeight( WE e )
- {
- if ( weighted != null )
- {
- return weighted.getWeight( e );
- }
- if ( weights.containsKey( e ) )
- {
- return weights.get( e );
- }
- return 1.0;
- }
-
- /**
- * Sets the weight attribute of the DDirectedGraph object
- */
- public void setWeight( WE e, Number value )
- throws GraphException
- {
- if ( weighted != null )
- {
- throw new GraphException( "Unable to set weight." );
- }
-
- weights.put( e, value );
- }
/**
* Description of the Method
@@ -150,7 +121,7 @@ public class DecoratedDirectedGraph<V ex
{
WE edge = edges.next();
- directedGraph.addEdge( edge, getTarget( edge ), getSource( edge ) );
+ directedGraph.addEdge( edge, edge.getTail(), edge.getHead() );
}
return directedGraph;