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 |
---|---|
protected java.util.Map<E,N> |
incidentEdgeMap
Keys are edges incident to the origin node, values are the node at the other end.
|
Modifier | Constructor and Description |
---|---|
protected |
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. |
java.util.Set<E> |
incidentEdges() |
java.util.Set<E> |
inEdges() |
N |
oppositeNode(java.lang.Object edge)
Returns the node that is opposite the origin node along
edge . |
java.util.Set<E> |
outEdges() |
java.util.Set<N> |
predecessors() |
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() |
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 oppositeNode(java.lang.Object edge)
NetworkConnections
edge
.
In the directed case, edge
is assumed to be an outgoing edge.
oppositeNode
in interface NetworkConnections<N,E>
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>
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>
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>