commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1134836 - in /commons/sandbox/graph/trunk/src: main/java/org/apache/commons/graph/algorithm/spanning/ main/java/org/apache/commons/graph/contract/ main/java/org/apache/commons/graph/decorator/ main/java/org/apache/commons/graph/domain/depe...
Date Sat, 11 Jun 2011 23:58:02 GMT
Author: simonetripodi
Date: Sat Jun 11 23:58:02 2011
New Revision: 1134836

URL: http://svn.apache.org/viewvc?rev=1134836&view=rev
Log:
decorated graph class name made esplicit, name that contain achronyms are not intuitive

Added:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
  (contents, props changed)
      - copied, changed from r1134835, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java
Removed:
    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/algorithm/spanning/MinimumSpanningForest.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/contract/AcyclicContract.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/dependency/DependencyGraph.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/statemachine/StateMachine.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/decorator/TransposeTest.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/algorithm/spanning/MinimumSpanningForest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/algorithm/spanning/MinimumSpanningForest.java?rev=1134836&r1=1134835&r2=1134836&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/algorithm/spanning/MinimumSpanningForest.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/algorithm/spanning/MinimumSpanningForest.java
Sat Jun 11 23:58:02 2011
@@ -44,7 +44,7 @@ public class MinimumSpanningForest
   private Map labels = new HashMap(); // VERTEX X LABEL
   private Set chords = new HashSet(); // Edges not in MSF.
   
-  private DDirectedGraph ddg = null;
+  private DecoratedDirectedGraph ddg = null;
 
   public class WeightedEdgeComparator
     implements Comparator

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/contract/AcyclicContract.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/contract/AcyclicContract.java?rev=1134836&r1=1134835&r2=1134836&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/contract/AcyclicContract.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/contract/AcyclicContract.java
Sat Jun 11 23:58:02 2011
@@ -29,10 +29,10 @@ import org.apache.commons.graph.decorato
 /**
  * Description of the Class
  */
-public class AcyclicContract
-     implements Contract
+public class AcyclicContract<V extends Vertex, E extends Edge>
+     implements Contract<V, E>
 {
-    private DDirectedGraph graph = null;
+    private DecoratedDirectedGraph graph = null;
 
     /**
      * Description of the Class
@@ -42,22 +42,22 @@ public class AcyclicContract
     {
         private DFS dfs = null;
         private boolean isCyclic = false;
-        private DirectedGraph graph = null;
+        private DirectedGraph<V, E> graph = null;
 
         /**
          * Constructor for the CycleDetector object
          *
          * @param graph
          */
-        public CycleDetector(DirectedGraph graph)
+        public CycleDetector(DirectedGraph<V, E> graph)
         {
             this.dfs = new DFS();
             this.graph = graph;
-            Iterator verts = graph.getVertices().iterator();
+            Iterator<V> verts = graph.getVertices().iterator();
 
             if (verts.hasNext())
             {
-                dfs.visit(graph, (Vertex) verts.next(), this);
+                dfs.visit(graph, verts.next(), this);
             }
         }
 
@@ -114,15 +114,15 @@ public class AcyclicContract
     /**
      * Sets the impl attribute of the AcyclicContract object
      */
-    public void setImpl(DirectedGraph graph)
+    public void setImpl(DirectedGraph<V, E> graph)
     {
-        this.graph = DDirectedGraph.decorateGraph(graph);
+        this.graph = DecoratedDirectedGraph.decorateGraph(graph);
     }
 
     /**
      * Gets the interface attribute of the AcyclicContract object
      */
-    public Class getInterface()
+    public Class<?> getInterface()
     {
         return org.apache.commons.graph.contract.Acyclic.class;
     }

Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
(from r1134835, 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/DecoratedDirectedGraph.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java&p1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DDirectedGraph.java&r1=1134835&r2=1134836&rev=1134836&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/DecoratedDirectedGraph.java
Sat Jun 11 23:58:02 2011
@@ -39,32 +39,32 @@ import org.apache.commons.graph.domain.b
 /**
  * Description of the Class
  */
-public class DDirectedGraph<V extends Vertex, WE extends WeightedEdge>
+public class DecoratedDirectedGraph<V extends Vertex, WE extends WeightedEdge>
     extends DirectedGraphWrapper<V, WE>
     implements DirectedGraph<V, WE>, WeightedGraph<V, WE>
 {
 
-    private static final Map<DirectedGraph<? extends Vertex, ? extends Edge>, DDirectedGraph<?
extends Vertex, ? extends Edge>>
-    DECORATED_GRAPHS = new HashMap<DirectedGraph<? extends Vertex, ? extends Edge>,
DDirectedGraph<? extends Vertex, ? extends Edge>>();// DGRAPH X DDGRAPH
+    private static final Map<DirectedGraph<? extends Vertex, ? extends Edge>, DecoratedDirectedGraph<?
extends Vertex, ? extends Edge>>
+    DECORATED_GRAPHS = new HashMap<DirectedGraph<? extends Vertex, ? extends Edge>,
DecoratedDirectedGraph<? extends Vertex, ? extends Edge>>();// DGRAPH X DDGRAPH
 
     /**
      * Description of the Method
      */
-    public static <V extends Vertex, WE extends WeightedEdge> DDirectedGraph<V,
WE> decorateGraph( DirectedGraph<V, WE> graph )
+    public static <V extends Vertex, WE extends WeightedEdge> DecoratedDirectedGraph<V,
WE> decorateGraph( DirectedGraph<V, WE> graph )
     {
-        if ( graph instanceof DDirectedGraph )
+        if ( graph instanceof DecoratedDirectedGraph )
         {
-            return (DDirectedGraph<V, WE>) graph;
+            return (DecoratedDirectedGraph<V, WE>) graph;
         }
 
         if ( DECORATED_GRAPHS.containsKey( graph ) )
         {
             @SuppressWarnings( "unchecked" ) // driven by graph parameter type
-            DDirectedGraph<V, WE> decorated = (DDirectedGraph<V, WE>) DECORATED_GRAPHS.get(
graph );
+            DecoratedDirectedGraph<V, WE> decorated = (DecoratedDirectedGraph<V,
WE>) DECORATED_GRAPHS.get( graph );
             return decorated;
         }
 
-        DDirectedGraph<V, WE> decorated = new DDirectedGraph<V, WE>( graph );
+        DecoratedDirectedGraph<V, WE> decorated = new DecoratedDirectedGraph<V,
WE>( graph );
         DECORATED_GRAPHS.put( graph, decorated );
         return decorated;
     }
@@ -80,7 +80,7 @@ public class DDirectedGraph<V extends Ve
      *
      * @param impl
      */
-    protected DDirectedGraph( DirectedGraph<V, WE> impl )
+    protected DecoratedDirectedGraph( DirectedGraph<V, WE> impl )
     {
         super( impl );
 

Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/decorator/DecoratedDirectedGraph.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/dependency/DependencyGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/dependency/DependencyGraph.java?rev=1134836&r1=1134835&r2=1134836&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/dependency/DependencyGraph.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/dependency/DependencyGraph.java
Sat Jun 11 23:58:02 2011
@@ -23,7 +23,7 @@ import org.apache.commons.graph.*;
 import org.apache.commons.graph.contract.*;
 import org.apache.commons.graph.exception.*;
 import org.apache.commons.graph.factory.GraphFactory;
-import org.apache.commons.graph.decorator.DDirectedGraph;
+import org.apache.commons.graph.decorator.DecoratedDirectedGraph;
 import org.apache.commons.graph.domain.dependency.exception.CircularDependencyException;
 
 import java.util.Collection;
@@ -36,7 +36,7 @@ import java.util.Map;
  * Description of the Class
  */
 public class DependencyGraph
-     extends DDirectedGraph
+     extends DecoratedDirectedGraph
   implements Acyclic
 {
     private GraphFactory factory = new GraphFactory();

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/statemachine/StateMachine.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/statemachine/StateMachine.java?rev=1134836&r1=1134835&r2=1134836&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/statemachine/StateMachine.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/domain/statemachine/StateMachine.java
Sat Jun 11 23:58:02 2011
@@ -8,7 +8,7 @@ import java.util.Set;
 import org.apache.commons.graph.GraphException;
 import org.apache.commons.graph.MutableDirectedGraph;
 import org.apache.commons.graph.contract.Contract;
-import org.apache.commons.graph.decorator.DDirectedGraph;
+import org.apache.commons.graph.decorator.DecoratedDirectedGraph;
 import org.apache.commons.graph.factory.GraphFactory;
 
 /**
@@ -18,7 +18,7 @@ import org.apache.commons.graph.factory.
  * of states and transitions which move between them.
  */
 public class StateMachine
-     extends DDirectedGraph
+     extends DecoratedDirectedGraph
 {
   private Map states = new HashMap();// NAME X STATE
   private Map transes = new HashMap();// NAME X TRANSITION

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/decorator/TransposeTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/decorator/TransposeTest.java?rev=1134836&r1=1134835&r2=1134836&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/decorator/TransposeTest.java
(original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/decorator/TransposeTest.java
Sat Jun 11 23:58:02 2011
@@ -43,8 +43,8 @@ public class TransposeTest
     public void testParentTree()
         throws Throwable
     {
-        DDirectedGraph graph =
-            DDirectedGraph.decorateGraph(makeParentTree());
+        DecoratedDirectedGraph graph =
+            DecoratedDirectedGraph.decorateGraph(makeParentTree());
 
         DirectedGraph IUT = graph.transpose();
 



Mime
View raw message