Author: simonetripodi
Date: Sat Jun 11 23:47:05 2011
New Revision: 1134831
URL: http://svn.apache.org/viewvc?rev=1134831&view=rev
Log:
reorganized stuff, static fields/methods first
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java?rev=1134831&r1=1134830&r2=1134831&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java
Sat Jun 11 23:47:05 2011
@@ -43,12 +43,32 @@ public class DDirectedGraph<V extends Ve
implements DirectedGraph<V, WE>, WeightedGraph<V, WE>
{
+ private static final Map decoratedGraphs = new HashMap();// DGRAPH X
DDGRAPH
+
+ /**
+ * Description of the Method
+ */
+ public static <V extends Vertex, WE extends WeightedEdge>
DDirectedGraph<V, WE> decorateGraph( DirectedGraph<V, WE> graph )
+ {
+ if ( graph instanceof DDirectedGraph )
+ {
+ return (DDirectedGraph<V, WE>) graph;
+ }
+
+ if ( decoratedGraphs.containsKey( graph ) )
+ {
+ return (DDirectedGraph<V, WE>) decoratedGraphs.get( graph );
+ }
+
+ DDirectedGraph<V, WE> RC = new DDirectedGraph<V, WE>( graph );
+ decoratedGraphs.put( graph, RC );
+ return RC;
+ }
+
private final WeightedGraph<V, WE> weighted;
private Map<WE, Number> weights = new HashMap<WE, Number>();// EDGE X
DOUBLE
- private static final Map decoratedGraphs = new HashMap();// DGRAPH X
DDGRAPH
-
private AllPairsShortestPath allPaths = null;
/**
@@ -70,26 +90,6 @@ public class DDirectedGraph<V extends Ve
}
}
- /**
- * Description of the Method
- */
- public static <V extends Vertex, WE extends WeightedEdge>
DDirectedGraph<V, WE> decorateGraph( DirectedGraph<V, WE> graph )
- {
- if ( graph instanceof DDirectedGraph )
- {
- return (DDirectedGraph<V, WE>) graph;
- }
-
- if ( decoratedGraphs.containsKey( graph ) )
- {
- return (DDirectedGraph<V, WE>) decoratedGraphs.get( graph );
- }
-
- DDirectedGraph<V, WE> RC = new DDirectedGraph<V, WE>( graph );
- decoratedGraphs.put( graph, RC );
- return RC;
- }
-
// WeightedGraph Implementation
/**
* Gets the weight attribute of the DDirectedGraph object