Skip to content

Commit

Permalink
Rename NodeConnections to NetworkConnections and NodeAdjacencies to G…
Browse files Browse the repository at this point in the history
…raphConnections. Have a base interface called "NodeConnections". This change is just cosmetic right now (although we do refer to these things as "connections" everywhere, so it's nice to actually have "NodeConnections" be the base interface), but it will make more sense in the context of ValueGraph (there will be a ValueGraphConnections).

However, I think this change is worthwhile (or at least not harmful) even outside of ValueGraph. And a rename like this, if bundled like with a large functional CL, will clutter things up a lot.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127552346
  • Loading branch information
Bezier89 authored and cpovirk committed Jul 15, 2016
1 parent 453d921 commit d6ef78f
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 169 deletions.
16 changes: 8 additions & 8 deletions guava/src/com/google/common/graph/AbstractConfigurableGraph.java
Expand Up @@ -30,7 +30,7 @@
* Abstract configurable implementation of {@link Graph} that supports the options supplied * Abstract configurable implementation of {@link Graph} that supports the options supplied
* by {@link GraphBuilder}. * by {@link GraphBuilder}.
* *
* <p>This class maintains a map of nodes to {@link NodeAdjacencies}. * <p>This class maintains a map of nodes to {@link GraphConnections}.
* *
* <p>{@code Set}-returning accessors return unmodifiable views: the view returned will reflect * <p>{@code Set}-returning accessors return unmodifiable views: the view returned will reflect
* changes to the graph (if the graph is mutable) but may not be modified by the user. * changes to the graph (if the graph is mutable) but may not be modified by the user.
Expand All @@ -55,15 +55,15 @@ abstract class AbstractConfigurableGraph<N> extends AbstractGraph<N> {
private final boolean allowsSelfLoops; private final boolean allowsSelfLoops;
private final ElementOrder<? super N> nodeOrder; private final ElementOrder<? super N> nodeOrder;


protected final MapIteratorCache<N, NodeAdjacencies<N>> nodeConnections; protected final MapIteratorCache<N, GraphConnections<N>> nodeConnections;


/** /**
* Constructs a graph with the properties specified in {@code builder}. * Constructs a graph with the properties specified in {@code builder}.
*/ */
AbstractConfigurableGraph(GraphBuilder<? super N> builder) { AbstractConfigurableGraph(GraphBuilder<? super N> builder) {
this( this(
builder, builder,
builder.nodeOrder.<N, NodeAdjacencies<N>>createMap( builder.nodeOrder.<N, GraphConnections<N>>createMap(
builder.expectedNodeCount.or(DEFAULT_NODE_COUNT))); builder.expectedNodeCount.or(DEFAULT_NODE_COUNT)));
} }


Expand All @@ -72,14 +72,14 @@ abstract class AbstractConfigurableGraph<N> extends AbstractGraph<N> {
* the given node map. * the given node map.
*/ */
AbstractConfigurableGraph(GraphBuilder<? super N> builder, AbstractConfigurableGraph(GraphBuilder<? super N> builder,
Map<N, NodeAdjacencies<N>> nodeConnections) { Map<N, GraphConnections<N>> nodeConnections) {
this.isDirected = builder.directed; this.isDirected = builder.directed;
this.allowsSelfLoops = builder.allowsSelfLoops; this.allowsSelfLoops = builder.allowsSelfLoops;
this.nodeOrder = builder.nodeOrder; this.nodeOrder = builder.nodeOrder;
// Prefer the heavier "MapRetrievalCache" for nodes if lookup is expensive. // Prefer the heavier "MapRetrievalCache" for nodes if lookup is expensive.
this.nodeConnections = (nodeConnections instanceof TreeMap) this.nodeConnections = (nodeConnections instanceof TreeMap)
? new MapRetrievalCache<N, NodeAdjacencies<N>>(nodeConnections) ? new MapRetrievalCache<N, GraphConnections<N>>(nodeConnections)
: new MapIteratorCache<N, NodeAdjacencies<N>>(nodeConnections); : new MapIteratorCache<N, GraphConnections<N>>(nodeConnections);
} }


/** /**
Expand Down Expand Up @@ -124,9 +124,9 @@ public Set<N> successors(Object node) {
return checkedConnections(node).successors(); return checkedConnections(node).successors();
} }


protected final NodeAdjacencies<N> checkedConnections(Object node) { protected final GraphConnections<N> checkedConnections(Object node) {
checkNotNull(node, "node"); checkNotNull(node, "node");
NodeAdjacencies<N> connections = nodeConnections.get(node); GraphConnections<N> connections = nodeConnections.get(node);
checkArgument(connections != null, NODE_NOT_IN_GRAPH, node); checkArgument(connections != null, NODE_NOT_IN_GRAPH, node);
return connections; return connections;
} }
Expand Down
Expand Up @@ -34,7 +34,7 @@
* Abstract configurable implementation of {@link Network} that supports the options supplied * Abstract configurable implementation of {@link Network} that supports the options supplied
* by {@link NetworkBuilder}. * by {@link NetworkBuilder}.
* *
* <p>This class maintains a map of nodes to {@link NodeConnections}. This class also maintains * <p>This class maintains a map of nodes to {@link NetworkConnections}. This class also maintains
* a map of edges to reference nodes. The reference node is defined to be the edge's source node * a map of edges to reference nodes. The reference node is defined to be the edge's source node
* on directed graphs, and an arbitrary endpoint of the edge on undirected graphs. * on directed graphs, and an arbitrary endpoint of the edge on undirected graphs.
* *
Expand Down Expand Up @@ -64,7 +64,7 @@ abstract class AbstractConfigurableNetwork<N, E> extends AbstractNetwork<N, E> {
private final ElementOrder<? super N> nodeOrder; private final ElementOrder<? super N> nodeOrder;
private final ElementOrder<? super E> edgeOrder; private final ElementOrder<? super E> edgeOrder;


protected final MapIteratorCache<N, NodeConnections<N, E>> nodeConnections; protected final MapIteratorCache<N, NetworkConnections<N, E>> nodeConnections;


// We could make this a Map<E, Endpoints<N>>. It would make incidentNodes(edge) slightly faster, // We could make this a Map<E, Endpoints<N>>. It would make incidentNodes(edge) slightly faster,
// but it would also make Networks consume 5 to 20+% (increasing with average degree) more memory. // but it would also make Networks consume 5 to 20+% (increasing with average degree) more memory.
Expand All @@ -76,7 +76,7 @@ abstract class AbstractConfigurableNetwork<N, E> extends AbstractNetwork<N, E> {
AbstractConfigurableNetwork(NetworkBuilder<? super N, ? super E> builder) { AbstractConfigurableNetwork(NetworkBuilder<? super N, ? super E> builder) {
this( this(
builder, builder,
builder.nodeOrder.<N, NodeConnections<N, E>>createMap( builder.nodeOrder.<N, NetworkConnections<N, E>>createMap(
builder.expectedNodeCount.or(DEFAULT_NODE_COUNT)), builder.expectedNodeCount.or(DEFAULT_NODE_COUNT)),
builder.edgeOrder.<E, N>createMap( builder.edgeOrder.<E, N>createMap(
builder.expectedEdgeCount.or(DEFAULT_EDGE_COUNT))); builder.expectedEdgeCount.or(DEFAULT_EDGE_COUNT)));
Expand All @@ -87,7 +87,7 @@ abstract class AbstractConfigurableNetwork<N, E> extends AbstractNetwork<N, E> {
* the given node and edge maps. * the given node and edge maps.
*/ */
AbstractConfigurableNetwork(NetworkBuilder<? super N, ? super E> builder, AbstractConfigurableNetwork(NetworkBuilder<? super N, ? super E> builder,
Map<N, NodeConnections<N, E>> nodeConnections, Map<N, NetworkConnections<N, E>> nodeConnections,
Map<E, N> edgeToReferenceNode) { Map<E, N> edgeToReferenceNode) {
this.isDirected = builder.directed; this.isDirected = builder.directed;
this.allowsParallelEdges = builder.allowsParallelEdges; this.allowsParallelEdges = builder.allowsParallelEdges;
Expand All @@ -97,8 +97,8 @@ abstract class AbstractConfigurableNetwork<N, E> extends AbstractNetwork<N, E> {
// Prefer the heavier "MapRetrievalCache" for nodes if lookup is expensive. This optimizes // Prefer the heavier "MapRetrievalCache" for nodes if lookup is expensive. This optimizes
// methods that access the same node(s) repeatedly, such as Graphs.removeEdgesConnecting(). // methods that access the same node(s) repeatedly, such as Graphs.removeEdgesConnecting().
this.nodeConnections = (nodeConnections instanceof TreeMap) this.nodeConnections = (nodeConnections instanceof TreeMap)
? new MapRetrievalCache<N, NodeConnections<N, E>>(nodeConnections) ? new MapRetrievalCache<N, NetworkConnections<N, E>>(nodeConnections)
: new MapIteratorCache<N, NodeConnections<N, E>>(nodeConnections); : new MapIteratorCache<N, NetworkConnections<N, E>>(nodeConnections);
this.edgeToReferenceNode = new MapIteratorCache<E, N>(edgeToReferenceNode); this.edgeToReferenceNode = new MapIteratorCache<E, N>(edgeToReferenceNode);
} }


Expand Down Expand Up @@ -178,7 +178,7 @@ public Set<E> adjacentEdges(Object edge) {


@Override @Override
public Set<E> edgesConnecting(Object nodeA, Object nodeB) { public Set<E> edgesConnecting(Object nodeA, Object nodeB) {
NodeConnections<N, E> connectionsA = checkedConnections(nodeA); NetworkConnections<N, E> connectionsA = checkedConnections(nodeA);
if (!allowsSelfLoops && nodeA.equals(nodeB)) { if (!allowsSelfLoops && nodeA.equals(nodeB)) {
return ImmutableSet.of(); return ImmutableSet.of();
} }
Expand Down Expand Up @@ -206,9 +206,9 @@ public Set<N> successors(Object node) {
return checkedConnections(node).successors(); return checkedConnections(node).successors();
} }


protected final NodeConnections<N, E> checkedConnections(Object node) { protected final NetworkConnections<N, E> checkedConnections(Object node) {
checkNotNull(node, "node"); checkNotNull(node, "node");
NodeConnections<N, E> connections = nodeConnections.get(node); NetworkConnections<N, E> connections = nodeConnections.get(node);
checkArgument(connections != null, NODE_NOT_IN_GRAPH, node); checkArgument(connections != null, NODE_NOT_IN_GRAPH, node);
return connections; return connections;
} }
Expand Down
Expand Up @@ -23,20 +23,19 @@
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.collect.UnmodifiableIterator; import com.google.common.collect.UnmodifiableIterator;
import com.google.common.math.IntMath; import com.google.common.math.IntMath;

import java.util.AbstractSet; import java.util.AbstractSet;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;


/** /**
* A base implementation of {@link NodeConnections} for directed networks. * A base implementation of {@link NetworkConnections} for directed networks.
* *
* @author James Sexton * @author James Sexton
* @param <N> Node parameter type * @param <N> Node parameter type
* @param <E> Edge parameter type * @param <E> Edge parameter type
*/ */
abstract class AbstractDirectedNodeConnections<N, E> implements NodeConnections<N, E> { abstract class AbstractDirectedNetworkConnections<N, E> implements NetworkConnections<N, E> {
/** /**
* Keys are edges incoming to the origin node, values are the source node. * Keys are edges incoming to the origin node, values are the source node.
*/ */
Expand All @@ -49,7 +48,7 @@ abstract class AbstractDirectedNodeConnections<N, E> implements NodeConnections<


private int selfLoopCount; private int selfLoopCount;


protected AbstractDirectedNodeConnections(Map<E, N> inEdgeMap, Map<E, N> outEdgeMap, protected AbstractDirectedNetworkConnections(Map<E, N> inEdgeMap, Map<E, N> outEdgeMap,
int selfLoopCount) { int selfLoopCount) {
this.inEdgeMap = checkNotNull(inEdgeMap, "inEdgeMap"); this.inEdgeMap = checkNotNull(inEdgeMap, "inEdgeMap");
this.outEdgeMap = checkNotNull(outEdgeMap, "outEdgeMap"); this.outEdgeMap = checkNotNull(outEdgeMap, "outEdgeMap");
Expand Down
Expand Up @@ -24,19 +24,19 @@
import java.util.Set; import java.util.Set;


/** /**
* A base implementation of {@link NodeConnections} for undirected networks. * A base implementation of {@link NetworkConnections} for undirected networks.
* *
* @author James Sexton * @author James Sexton
* @param <N> Node parameter type * @param <N> Node parameter type
* @param <E> Edge parameter type * @param <E> Edge parameter type
*/ */
abstract class AbstractUndirectedNodeConnections<N, E> implements NodeConnections<N, E> { abstract class AbstractUndirectedNetworkConnections<N, E> implements NetworkConnections<N, E> {
/** /**
* Keys are edges incident to the origin node, values are the node at the other end. * Keys are edges incident to the origin node, values are the node at the other end.
*/ */
protected final Map<E, N> incidentEdgeMap; protected final Map<E, N> incidentEdgeMap;


protected AbstractUndirectedNodeConnections(Map<E, N> incidentEdgeMap) { protected AbstractUndirectedNetworkConnections(Map<E, N> incidentEdgeMap) {
this.incidentEdgeMap = checkNotNull(incidentEdgeMap, "incidentEdgeMap"); this.incidentEdgeMap = checkNotNull(incidentEdgeMap, "incidentEdgeMap");
} }


Expand Down
22 changes: 11 additions & 11 deletions guava/src/com/google/common/graph/ConfigurableMutableGraph.java
Expand Up @@ -59,13 +59,13 @@ public boolean addNode(N node) {
} }


/** /**
* Adds {@code node} to the graph and returns the associated {@link NodeAdjacencies}. * Adds {@code node} to the graph and returns the associated {@link GraphConnections}.
* *
* @throws IllegalStateException if {@code node} is already present * @throws IllegalStateException if {@code node} is already present
*/ */
@CanIgnoreReturnValue @CanIgnoreReturnValue
private NodeAdjacencies<N> addNodeInternal(N node) { private GraphConnections<N> addNodeInternal(N node) {
NodeAdjacencies<N> connections = newNodeConnections(); GraphConnections<N> connections = newConnections();
checkState(nodeConnections.put(node, connections) == null); checkState(nodeConnections.put(node, connections) == null);
return connections; return connections;
} }
Expand All @@ -76,7 +76,7 @@ public boolean addEdge(N nodeA, N nodeB) {
checkNotNull(nodeA, "nodeA"); checkNotNull(nodeA, "nodeA");
checkNotNull(nodeB, "nodeB"); checkNotNull(nodeB, "nodeB");


NodeAdjacencies<N> connectionsA = nodeConnections.get(nodeA); GraphConnections<N> connectionsA = nodeConnections.get(nodeA);
// TODO(b/28087289): does not support parallel edges // TODO(b/28087289): does not support parallel edges
if (connectionsA != null && connectionsA.successors().contains(nodeB)) { if (connectionsA != null && connectionsA.successors().contains(nodeB)) {
return false; return false;
Expand All @@ -90,7 +90,7 @@ public boolean addEdge(N nodeA, N nodeB) {
connectionsA = addNodeInternal(nodeA); connectionsA = addNodeInternal(nodeA);
} }
connectionsA.addSuccessor(nodeB); connectionsA.addSuccessor(nodeB);
NodeAdjacencies<N> connectionsB = nodeConnections.get(nodeB); GraphConnections<N> connectionsB = nodeConnections.get(nodeB);
if (connectionsB == null) { if (connectionsB == null) {
connectionsB = addNodeInternal(nodeB); connectionsB = addNodeInternal(nodeB);
} }
Expand All @@ -103,7 +103,7 @@ public boolean addEdge(N nodeA, N nodeB) {
public boolean removeNode(Object node) { public boolean removeNode(Object node) {
checkNotNull(node, "node"); checkNotNull(node, "node");


NodeAdjacencies<N> connections = nodeConnections.get(node); GraphConnections<N> connections = nodeConnections.get(node);
if (connections == null) { if (connections == null) {
return false; return false;
} }
Expand All @@ -129,20 +129,20 @@ public boolean removeEdge(Object nodeA, Object nodeB) {
checkNotNull(nodeA, "nodeA"); checkNotNull(nodeA, "nodeA");
checkNotNull(nodeB, "nodeB"); checkNotNull(nodeB, "nodeB");


NodeAdjacencies<N> connectionsA = nodeConnections.get(nodeA); GraphConnections<N> connectionsA = nodeConnections.get(nodeA);
if (connectionsA == null || !connectionsA.successors().contains(nodeB)) { if (connectionsA == null || !connectionsA.successors().contains(nodeB)) {
return false; return false;
} }


NodeAdjacencies<N> connectionsB = nodeConnections.get(nodeB); GraphConnections<N> connectionsB = nodeConnections.get(nodeB);
connectionsA.removeSuccessor(nodeB); connectionsA.removeSuccessor(nodeB);
connectionsB.removePredecessor(nodeA); connectionsB.removePredecessor(nodeA);
return true; return true;
} }


private NodeAdjacencies<N> newNodeConnections() { private GraphConnections<N> newConnections() {
return isDirected() return isDirected()
? DirectedNodeAdjacencies.<N>of() ? DirectedGraphConnections.<N>of()
: UndirectedNodeAdjacencies.<N>of(); : UndirectedGraphConnections.<N>of();
} }
} }
26 changes: 13 additions & 13 deletions guava/src/com/google/common/graph/ConfigurableMutableNetwork.java
Expand Up @@ -63,13 +63,13 @@ public boolean addNode(N node) {
} }


/** /**
* Adds {@code node} to the graph and returns the associated {@link NodeConnections}. * Adds {@code node} to the graph and returns the associated {@link NetworkConnections}.
* *
* @throws IllegalStateException if {@code node} is already present * @throws IllegalStateException if {@code node} is already present
*/ */
@CanIgnoreReturnValue @CanIgnoreReturnValue
private NodeConnections<N, E> addNodeInternal(N node) { private NetworkConnections<N, E> addNodeInternal(N node) {
NodeConnections<N, E> connections = newNodeConnections(); NetworkConnections<N, E> connections = newConnections();
checkState(nodeConnections.put(node, connections) == null); checkState(nodeConnections.put(node, connections) == null);
return connections; return connections;
} }
Expand All @@ -88,7 +88,7 @@ public boolean addEdge(E edge, N nodeA, N nodeB) {
REUSING_EDGE, edge, existingEndpoints, newEndpoints); REUSING_EDGE, edge, existingEndpoints, newEndpoints);
return false; return false;
} }
NodeConnections<N, E> connectionsA = nodeConnections.get(nodeA); NetworkConnections<N, E> connectionsA = nodeConnections.get(nodeA);
if (!allowsParallelEdges()) { if (!allowsParallelEdges()) {
checkArgument(!(connectionsA != null && connectionsA.successors().contains(nodeB)), checkArgument(!(connectionsA != null && connectionsA.successors().contains(nodeB)),
PARALLEL_EDGES_NOT_ALLOWED, nodeA, nodeB); PARALLEL_EDGES_NOT_ALLOWED, nodeA, nodeB);
Expand All @@ -102,7 +102,7 @@ public boolean addEdge(E edge, N nodeA, N nodeB) {
connectionsA = addNodeInternal(nodeA); connectionsA = addNodeInternal(nodeA);
} }
connectionsA.addOutEdge(edge, nodeB); connectionsA.addOutEdge(edge, nodeB);
NodeConnections<N, E> connectionsB = nodeConnections.get(nodeB); NetworkConnections<N, E> connectionsB = nodeConnections.get(nodeB);
if (connectionsB == null) { if (connectionsB == null) {
connectionsB = addNodeInternal(nodeB); connectionsB = addNodeInternal(nodeB);
} }
Expand All @@ -116,7 +116,7 @@ public boolean addEdge(E edge, N nodeA, N nodeB) {
public boolean removeNode(Object node) { public boolean removeNode(Object node) {
checkNotNull(node, "node"); checkNotNull(node, "node");


NodeConnections<N, E> connections = nodeConnections.get(node); NetworkConnections<N, E> connections = nodeConnections.get(node);
if (connections == null) { if (connections == null) {
return false; return false;
} }
Expand All @@ -140,22 +140,22 @@ public boolean removeEdge(Object edge) {
return false; return false;
} }


NodeConnections<N, E> connectionsA = nodeConnections.get(nodeA); NetworkConnections<N, E> connectionsA = nodeConnections.get(nodeA);
N nodeB = connectionsA.oppositeNode(edge); N nodeB = connectionsA.oppositeNode(edge);
NodeConnections<N, E> connectionsB = nodeConnections.get(nodeB); NetworkConnections<N, E> connectionsB = nodeConnections.get(nodeB);
connectionsA.removeOutEdge(edge); connectionsA.removeOutEdge(edge);
connectionsB.removeInEdge(edge, allowsSelfLoops() && nodeA.equals(nodeB)); connectionsB.removeInEdge(edge, allowsSelfLoops() && nodeA.equals(nodeB));
edgeToReferenceNode.remove(edge); edgeToReferenceNode.remove(edge);
return true; return true;
} }


private NodeConnections<N, E> newNodeConnections() { private NetworkConnections<N, E> newConnections() {
return isDirected() return isDirected()
? allowsParallelEdges() ? allowsParallelEdges()
? DirectedMultiNodeConnections.<N, E>of() ? DirectedMultiNetworkConnections.<N, E>of()
: DirectedNodeConnections.<N, E>of() : DirectedNetworkConnections.<N, E>of()
: allowsParallelEdges() : allowsParallelEdges()
? UndirectedMultiNodeConnections.<N, E>of() ? UndirectedMultiNetworkConnections.<N, E>of()
: UndirectedNodeConnections.<N, E>of(); : UndirectedNetworkConnections.<N, E>of();
} }
} }
Expand Up @@ -24,15 +24,13 @@
import com.google.common.collect.AbstractIterator; import com.google.common.collect.AbstractIterator;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.UnmodifiableIterator; import com.google.common.collect.UnmodifiableIterator;

import java.util.AbstractSet; import java.util.AbstractSet;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;

import javax.annotation.Nullable; import javax.annotation.Nullable;


/** /**
Expand All @@ -41,7 +39,7 @@
* @author James Sexton * @author James Sexton
* @param <N> Node parameter type * @param <N> Node parameter type
*/ */
final class DirectedNodeAdjacencies<N> implements NodeAdjacencies<N> { final class DirectedGraphConnections<N> implements GraphConnections<N> {
enum Adjacency { enum Adjacency {
PRED, PRED,
SUCC, SUCC,
Expand All @@ -53,23 +51,23 @@ enum Adjacency {
private int predecessorCount; private int predecessorCount;
private int successorCount; private int successorCount;


private DirectedNodeAdjacencies( private DirectedGraphConnections(
Map<N, Adjacency> adjacentNodes, int predecessorCount, int successorCount) { Map<N, Adjacency> adjacentNodes, int predecessorCount, int successorCount) {
this.adjacentNodes = checkNotNull(adjacentNodes, "adjacentNodes"); this.adjacentNodes = checkNotNull(adjacentNodes, "adjacentNodes");
this.predecessorCount = predecessorCount; this.predecessorCount = predecessorCount;
this.successorCount = successorCount; this.successorCount = successorCount;
} }


static <N> DirectedNodeAdjacencies<N> of() { static <N> DirectedGraphConnections<N> of() {
// We store predecessors and successors in the same map, so double the initial capacity. // We store predecessors and successors in the same map, so double the initial capacity.
int initialCapacity = INNER_CAPACITY * 2; int initialCapacity = INNER_CAPACITY * 2;
return new DirectedNodeAdjacencies<N>( return new DirectedGraphConnections<N>(
new HashMap<N, Adjacency>(initialCapacity, INNER_LOAD_FACTOR), 0, 0); new HashMap<N, Adjacency>(initialCapacity, INNER_LOAD_FACTOR), 0, 0);
} }


static <N> DirectedNodeAdjacencies<N> ofImmutable( static <N> DirectedGraphConnections<N> ofImmutable(
Map<N, Adjacency> adjacentNodes, int predecessorCount, int successorCount) { Map<N, Adjacency> adjacentNodes, int predecessorCount, int successorCount) {
return new DirectedNodeAdjacencies<N>( return new DirectedGraphConnections<N>(
ImmutableMap.copyOf(adjacentNodes), predecessorCount, successorCount); ImmutableMap.copyOf(adjacentNodes), predecessorCount, successorCount);
} }


Expand Down

0 comments on commit d6ef78f

Please sign in to comment.