Top Description Fields Constructors Methods
com.google.common.graph

pack-priv final Class DirectedMultiNetworkConnections<N, E>

extends AbstractDirectedNetworkConnections<N, E>
Class Inheritance
Annotations
@ElementTypesAreNonnullByDefault
Type Parameters
<N>
Node parameter type
<E>
Edge parameter type
Static Imports
com.google.common.base.Preconditions.checkState, com.google.common.graph.GraphConstants.INNER_CAPACITY, .GraphConstants.INNER_LOAD_FACTOR

An implementation of NetworkConnections for directed networks with parallel edges.
Author
James Sexton

Field Summary

Modifier and TypeField and Description
private transient Reference<Multiset<N>>
private transient Reference<Multiset<N>>
Inherited from com.google.common.graph.AbstractDirectedNetworkConnections:
inEdgeMapoutEdgeMap

Constructor Summary

AccessConstructor and Description
private
DirectedMultiNetworkConnections(Map<E, N> inEdges, Map<E, N> outEdges, int selfLoopCount)

Method Summary

Modifier and TypeMethod and Description
public void
addInEdge(E edge, N node, boolean isSelfLoop)

Overrides com.google.common.graph.AbstractDirectedNetworkConnections.addInEdge.

Implements com.google.common.graph.NetworkConnections.addInEdge.

Add edge to the set of incoming edges.
public void
public Set<E>
edgesConnecting(N node)

Implements com.google.common.graph.NetworkConnections.edgesConnecting.

Returns the set of edges connecting the origin node to node.
private static <T> T
getReference(Reference<T> reference)

pack-priv static <N, E> DirectedMultiNetworkConnections<N, E>
of()

pack-priv static <N, E> DirectedMultiNetworkConnections<N, E>
ofImmutable(Map<E, N> inEdges, Map<E, N> outEdges, int selfLoopCount)

public Set<N>
private Multiset<N>
public N
removeInEdge(E edge, boolean isSelfLoop)

Overrides com.google.common.graph.AbstractDirectedNetworkConnections.removeInEdge.

Implements com.google.common.graph.NetworkConnections.removeInEdge.

Remove edge from the set of incoming edges.
public N
public Set<N>
private Multiset<N>
Inherited from com.google.common.graph.AbstractDirectedNetworkConnections:
adjacentNodeadjacentNodesincidentEdgesinEdgesoutEdges

Field Detail

predecessorsReferenceback to summary
private transient Reference<Multiset<N>> predecessorsReference
Annotations
@CheckForNull
@LazyInit
successorsReferenceback to summary
private transient Reference<Multiset<N>> successorsReference
Annotations
@CheckForNull
@LazyInit

Constructor Detail

DirectedMultiNetworkConnectionsback to summary
private DirectedMultiNetworkConnections(Map<E, N> inEdges, Map<E, N> outEdges, int selfLoopCount)

Method Detail

addInEdgeback to summary
public void addInEdge(E edge, N node, boolean isSelfLoop)

Overrides com.google.common.graph.AbstractDirectedNetworkConnections.addInEdge.

Implements com.google.common.graph.NetworkConnections.addInEdge.

Doc from com.google.common.graph.NetworkConnections.addInEdge.

Add edge to the set of incoming edges. Implicitly adds node as a predecessor.

Annotations
@Override
addOutEdgeback to summary
public void addOutEdge(E edge, N node)

Overrides com.google.common.graph.AbstractDirectedNetworkConnections.addOutEdge.

Implements com.google.common.graph.NetworkConnections.addOutEdge.

Doc from com.google.common.graph.NetworkConnections.addOutEdge.

Add edge to the set of outgoing edges. Implicitly adds node as a successor.

Annotations
@Override
edgesConnectingback to summary
public Set<E> edgesConnecting(N node)

Implements com.google.common.graph.NetworkConnections.edgesConnecting.

Doc from com.google.common.graph.NetworkConnections.edgesConnecting.

Returns the set of edges connecting the origin node to node. For networks without parallel edges, this set cannot be of size greater than one.

Annotations
@Override
getReferenceback to summary
private static <T> T getReference(Reference<T> reference)
Annotations
@CheckForNull
ofback to summary
pack-priv static <N, E> DirectedMultiNetworkConnections<N, E> of()
ofImmutableback to summary
pack-priv static <N, E> DirectedMultiNetworkConnections<N, E> ofImmutable(Map<E, N> inEdges, Map<E, N> outEdges, int selfLoopCount)
predecessorsback to summary
public Set<N> predecessors()

Implements com.google.common.graph.NetworkConnections.predecessors.

Annotations
@Override
predecessorsMultisetback to summary
private Multiset<N> predecessorsMultiset()
removeInEdgeback to summary
public N removeInEdge(E edge, boolean isSelfLoop)

Overrides com.google.common.graph.AbstractDirectedNetworkConnections.removeInEdge.

Implements com.google.common.graph.NetworkConnections.removeInEdge.

Doc from com.google.common.graph.NetworkConnections.removeInEdge.

Remove edge from the set of incoming edges. Returns the former predecessor node.

In the undirected case, returns null if isSelfLoop is true.

Annotations
@Override
removeOutEdgeback to summary
public N removeOutEdge(E edge)

Overrides com.google.common.graph.AbstractDirectedNetworkConnections.removeOutEdge.

Implements com.google.common.graph.NetworkConnections.removeOutEdge.

Doc from com.google.common.graph.NetworkConnections.removeOutEdge.

Remove edge from the set of outgoing edges. Returns the former successor node.

Annotations
@Override
successorsback to summary
public Set<N> successors()

Implements com.google.common.graph.NetworkConnections.successors.

Annotations
@Override
successorsMultisetback to summary
private Multiset<N> successorsMultiset()