N
- Node parameter typeE
- Edge parameter typefinal class UndirectedMultiNetworkConnections<N,E> extends AbstractUndirectedNetworkConnections<N,E>
NetworkConnections
for undirected networks with parallel edges.Modifier and Type | Field and Description |
---|---|
private java.lang.ref.Reference<Multiset<N>> |
adjacentNodesReference |
incidentEdgeMap
Modifier | Constructor and Description |
---|---|
private |
UndirectedMultiNetworkConnections(java.util.Map<E,N> incidentEdges) |
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<N> |
adjacentNodes() |
private Multiset<N> |
adjacentNodesMultiset() |
java.util.Set<E> |
edgesConnecting(N node) |
private static <T> T |
getReference(java.lang.ref.Reference<T> reference) |
(package private) static <N,E> UndirectedMultiNetworkConnections<N,E> |
of() |
(package private) static <N,E> UndirectedMultiNetworkConnections<N,E> |
ofImmutable(java.util.Map<E,N> incidentEdges) |
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. |
adjacentNode, incidentEdges, inEdges, outEdges, predecessors, successors
static <N,E> UndirectedMultiNetworkConnections<N,E> of()
static <N,E> UndirectedMultiNetworkConnections<N,E> ofImmutable(java.util.Map<E,N> incidentEdges)
public java.util.Set<N> adjacentNodes()
@CheckForNull 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 AbstractUndirectedNetworkConnections<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 AbstractUndirectedNetworkConnections<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 AbstractUndirectedNetworkConnections<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 AbstractUndirectedNetworkConnections<N,E>
@CheckForNull private static <T> T getReference(@CheckForNull java.lang.ref.Reference<T> reference)