Author: simonetripodi
Date: Fri Mar 2 20:44:36 2012
New Revision: 1296445
URL: http://svn.apache.org/viewvc?rev=1296445&view=rev
Log:
rolled back r1296087 that caused incredible decrease of performances
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/DirectedMutableGraph.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java?rev=1296445&r1=1296444&r2=1296445&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/BaseGraph.java
Fri Mar 2 20:44:36 2012
@@ -20,13 +20,13 @@ package org.apache.commons.graph.model;
*/
import static java.lang.String.format;
-import static java.util.Collections.newSetFromMap;
import static java.util.Collections.unmodifiableCollection;
import static java.util.Collections.unmodifiableSet;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Graph;
@@ -47,13 +47,13 @@ public abstract class BaseGraph<V extend
private static final long serialVersionUID = -8066786787634472712L;
- private final Map<V, Set<V>> adjacencyList = new ConcurrentHashMap<V,
Set<V>>();
+ private final Map<V, Set<V>> adjacencyList = new HashMap<V, Set<V>>();
- private final Set<E> allEdges = newSetFromMap( new ConcurrentHashMap<E, Boolean>()
);
+ private final Set<E> allEdges = new HashSet<E>();
- private final Map<VertexPair<V>, E> indexedEdges = new ConcurrentHashMap<VertexPair<V>,
E>();
+ private final Map<VertexPair<V>, E> indexedEdges = new HashMap<VertexPair<V>,
E>();
- private final Map<E, VertexPair<V>> indexedVertices = new ConcurrentHashMap<E,
VertexPair<V>>();
+ private final Map<E, VertexPair<V>> indexedVertices = new HashMap<E, VertexPair<V>>();
/**
* {@inheritDoc}
@@ -123,7 +123,7 @@ public abstract class BaseGraph<V extend
{
return adjacencyList.containsKey( v );
}
-
+
/**
* {@inheritDoc}
*/
@@ -131,7 +131,7 @@ public abstract class BaseGraph<V extend
{
return indexedVertices.containsKey( e );
}
-
+
/**
* Returns the adjacency list where stored vertex/edges.
*
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/DirectedMutableGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/DirectedMutableGraph.java?rev=1296445&r1=1296444&r2=1296445&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/DirectedMutableGraph.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/DirectedMutableGraph.java
Fri Mar 2 20:44:36 2012
@@ -19,10 +19,10 @@ package org.apache.commons.graph.model;
* under the License.
*/
+import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.graph.DirectedGraph;
import org.apache.commons.graph.Edge;
@@ -42,9 +42,9 @@ public class DirectedMutableGraph<V exte
private static final long serialVersionUID = 630111985439492792L;
- private final Map<V, Set<V>> inbound = new ConcurrentHashMap<V, Set<V>>();
+ private final Map<V, Set<V>> inbound = new HashMap<V, Set<V>>();
- private final Map<V, Set<V>> outbound = new ConcurrentHashMap<V, Set<V>>();
+ private final Map<V, Set<V>> outbound = new HashMap<V, Set<V>>();
/**
* {@inheritDoc}
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java?rev=1296445&r1=1296444&r2=1296445&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
Fri Mar 2 20:44:36 2012
@@ -19,16 +19,16 @@ package org.apache.commons.graph.model;
* under the License.
*/
-import static java.lang.String.format;
+import static org.apache.commons.graph.utils.Assertions.*;
+
import static java.util.Arrays.asList;
+import static java.lang.String.format;
import static java.util.Collections.unmodifiableList;
-import static org.apache.commons.graph.utils.Assertions.checkArgument;
-import static org.apache.commons.graph.utils.Assertions.checkNotNull;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Path;
@@ -56,11 +56,11 @@ public class InMemoryPath<V extends Vert
private final LinkedList<E> edges = new LinkedList<E>();
- private final Map<V, V> successors = new ConcurrentHashMap<V, V>();
+ private final Map<V, V> successors = new HashMap<V, V>();
- private final Map<VertexPair<V>, E> indexedEdges = new ConcurrentHashMap<VertexPair<V>,
E>();
+ private final Map<VertexPair<V>, E> indexedEdges = new HashMap<VertexPair<V>,
E>();
- private final Map<E, VertexPair<V>> indexedVertices = new ConcurrentHashMap<E,
VertexPair<V>>();
+ private final Map<E, VertexPair<V>> indexedVertices = new HashMap<E, VertexPair<V>>();
public InMemoryPath( V start, V target )
{
@@ -211,7 +211,7 @@ public class InMemoryPath<V extends Vert
{
return vertices.contains( v );
}
-
+
/**
* {@inheritDoc}
*/
|