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(java.lang.Object 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(java.lang.Object edge,
boolean isSelfLoop)
Remove
edge from the set of incoming edges. |
N |
removeOutEdge(java.lang.Object edge)
Remove
edge from the set of outgoing edges. |
java.util.Set<N> |
successors() |
private Multiset<N> |
successorsMultiset() |
adjacentNodes, incidentEdges, inEdges, oppositeNode, outEdges
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 java.util.Set<E> edgesConnecting(java.lang.Object node)
public N removeInEdge(java.lang.Object 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(java.lang.Object 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>
@Nullable private static <T> T getReference(@Nullable java.lang.ref.Reference<T> reference)