N - Node parameter typeE - Edge parameter typeabstract class AbstractDirectedNetworkConnections<N,E> extends java.lang.Object implements NetworkConnections<N,E>
NetworkConnections for directed networks.| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.Map<E,N> |
inEdgeMap
Keys are edges incoming to the origin node, values are the source node.
|
(package private) java.util.Map<E,N> |
outEdgeMap
Keys are edges outgoing from the origin node, values are the target node.
|
private int |
selfLoopCount |
| Constructor and Description |
|---|
AbstractDirectedNetworkConnections(java.util.Map<E,N> inEdgeMap,
java.util.Map<E,N> outEdgeMap,
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. |
N |
adjacentNode(E edge)
Returns the node that is adjacent to the origin node along
edge. |
java.util.Set<N> |
adjacentNodes() |
java.util.Set<E> |
incidentEdges() |
java.util.Set<E> |
inEdges() |
java.util.Set<E> |
outEdges() |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitedgesConnecting, predecessors, successorsfinal java.util.Map<E,N> inEdgeMap
final java.util.Map<E,N> outEdgeMap
private int selfLoopCount
public java.util.Set<N> adjacentNodes()
adjacentNodes 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)
NetworkConnectionsedge.
In the directed case, edge is assumed to be an outgoing edge.
adjacentNode in interface NetworkConnections<N,E>public N removeInEdge(E edge, boolean isSelfLoop)
NetworkConnectionsedge 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)
NetworkConnectionsedge 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)
NetworkConnectionsedge 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)
NetworkConnectionsedge to the set of outgoing edges. Implicitly adds node as a successor.addOutEdge in interface NetworkConnections<N,E>