N
- Node parameter typeE
- Edge parameter typefinal class DirectedMultiNetworkConnections<N,E> extends AbstractDirectedNetworkConnections<N,E>
NetworkConnections
for directed networks with parallel edges.Modifier and Type | Field and Description |
---|---|
private java.lang.ref.Reference<Multiset<N>> |
predecessorsReference |
private java.lang.ref.Reference<Multiset<N>> |
successorsReference |
inEdgeMap, outEdgeMap
Modifier | Constructor and Description |
---|---|
private |
DirectedMultiNetworkConnections(java.util.Map<E,N> inEdges,
java.util.Map<E,N> outEdges,
int selfLoopCount) |
Modifier and Type | Method and Description |
---|---|
void |
addInEdge(E edge,
N node,
boolean isSelfLoop)
Add
edge to the set of incoming edges. |
void |
addOutEdge(E edge,
N node)
Add
edge to the set of outgoing edges. |
java.util.Set<E> |
edgesConnecting(N node) |
private static <T> T |
getReference(java.lang.ref.Reference<T> reference) |
(package private) static <N,E> DirectedMultiNetworkConnections<N,E> |
of() |
(package private) static <N,E> DirectedMultiNetworkConnections<N,E> |
ofImmutable(java.util.Map<E,N> inEdges,
java.util.Map<E,N> outEdges,
int selfLoopCount) |
java.util.Set<N> |
predecessors() |
private Multiset<N> |
predecessorsMultiset() |
N |
removeInEdge(E edge,
boolean isSelfLoop)
Remove
edge from the set of incoming edges. |
N |
removeOutEdge(E edge)
Remove
edge from the set of outgoing edges. |
java.util.Set<N> |
successors() |
private Multiset<N> |
successorsMultiset() |
adjacentNode, adjacentNodes, incidentEdges, inEdges, outEdges
@CheckForNull private transient java.lang.ref.Reference<Multiset<N>> predecessorsReference
static <N,E> DirectedMultiNetworkConnections<N,E> of()
static <N,E> DirectedMultiNetworkConnections<N,E> ofImmutable(java.util.Map<E,N> inEdges, java.util.Map<E,N> outEdges, int selfLoopCount)
public java.util.Set<N> predecessors()
public java.util.Set<N> successors()
public N removeInEdge(E edge, boolean isSelfLoop)
NetworkConnections
edge
from the set of incoming edges. Returns the former predecessor node.
In the undirected case, returns null
if isSelfLoop
is true.
removeInEdge
in interface NetworkConnections<N,E>
removeInEdge
in class AbstractDirectedNetworkConnections<N,E>
public N removeOutEdge(E edge)
NetworkConnections
edge
from the set of outgoing edges. Returns the former successor node.removeOutEdge
in interface NetworkConnections<N,E>
removeOutEdge
in class AbstractDirectedNetworkConnections<N,E>
public void addInEdge(E edge, N node, boolean isSelfLoop)
NetworkConnections
edge
to the set of incoming edges. Implicitly adds node
as a predecessor.addInEdge
in interface NetworkConnections<N,E>
addInEdge
in class AbstractDirectedNetworkConnections<N,E>
public void addOutEdge(E edge, N node)
NetworkConnections
edge
to the set of outgoing edges. Implicitly adds node
as a successor.addOutEdge
in interface NetworkConnections<N,E>
addOutEdge
in class AbstractDirectedNetworkConnections<N,E>
@CheckForNull private static <T> T getReference(@CheckForNull java.lang.ref.Reference<T> reference)