N
- Node parameter typeE
- Edge parameter typeabstract class AbstractUndirectedNetworkConnections<N,E> extends java.lang.Object implements NetworkConnections<N,E>
NetworkConnections
for undirected networks.Modifier and Type | Field and Description |
---|---|
(package private) java.util.Map<E,N> |
incidentEdgeMap
Keys are edges incident to the origin node, values are the node at the other end.
|
Constructor and Description |
---|
AbstractUndirectedNetworkConnections(java.util.Map<E,N> incidentEdgeMap) |
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. |
N |
adjacentNode(E edge)
Returns the node that is adjacent to the origin node along
edge . |
java.util.Set<E> |
incidentEdges() |
java.util.Set<E> |
inEdges() |
java.util.Set<E> |
outEdges() |
java.util.Set<N> |
predecessors() |
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adjacentNodes, edgesConnecting
public java.util.Set<N> predecessors()
predecessors
in interface NetworkConnections<N,E>
public java.util.Set<N> successors()
successors
in interface NetworkConnections<N,E>
public java.util.Set<E> incidentEdges()
incidentEdges
in interface NetworkConnections<N,E>
public java.util.Set<E> inEdges()
inEdges
in interface NetworkConnections<N,E>
public java.util.Set<E> outEdges()
outEdges
in interface NetworkConnections<N,E>
public N adjacentNode(E edge)
NetworkConnections
edge
.
In the directed case, edge
is assumed to be an outgoing edge.
adjacentNode
in interface NetworkConnections<N,E>
@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>
public N removeOutEdge(E edge)
NetworkConnections
edge
from the set of outgoing edges. Returns the former successor node.removeOutEdge
in interface NetworkConnections<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>
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>