Package com.google.common.graph
Interface NetworkConnections<N,E>
-
- Type Parameters:
N
- Node parameter typeE
- Edge parameter type
- All Known Implementing Classes:
AbstractDirectedNetworkConnections
,AbstractUndirectedNetworkConnections
,DirectedMultiNetworkConnections
,DirectedNetworkConnections
,UndirectedMultiNetworkConnections
,UndirectedNetworkConnections
interface NetworkConnections<N,E>
An interface for representing and manipulating an origin node's adjacent nodes and incident edges in aNetwork
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addInEdge(E edge, N node, boolean isSelfLoop)
Addedge
to the set of incoming edges.void
addOutEdge(E edge, N node)
Addedge
to the set of outgoing edges.java.util.Set<N>
adjacentNodes()
java.util.Set<E>
edgesConnecting(java.lang.Object node)
Returns the set of edges connecting the origin node tonode
.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 alongedge
.java.util.Set<E>
outEdges()
java.util.Set<N>
predecessors()
N
removeInEdge(java.lang.Object edge, boolean isSelfLoop)
Removeedge
from the set of incoming edges.N
removeOutEdge(java.lang.Object edge)
Removeedge
from the set of outgoing edges.java.util.Set<N>
successors()
-
-
-
Method Detail
-
adjacentNodes
java.util.Set<N> adjacentNodes()
-
predecessors
java.util.Set<N> predecessors()
-
successors
java.util.Set<N> successors()
-
incidentEdges
java.util.Set<E> incidentEdges()
-
inEdges
java.util.Set<E> inEdges()
-
outEdges
java.util.Set<E> outEdges()
-
edgesConnecting
java.util.Set<E> edgesConnecting(java.lang.Object node)
Returns the set of edges connecting the origin node tonode
. For networks without parallel edges, this set cannot be of size greater than one.
-
oppositeNode
N oppositeNode(java.lang.Object edge)
Returns the node that is opposite the origin node alongedge
.In the directed case,
edge
is assumed to be an outgoing edge.
-
removeInEdge
N removeInEdge(java.lang.Object edge, boolean isSelfLoop)
Removeedge
from the set of incoming edges. Returns the former predecessor node.In the undirected case, returns
null
ifisSelfLoop
is true.
-
removeOutEdge
N removeOutEdge(java.lang.Object edge)
Removeedge
from the set of outgoing edges. Returns the former successor node.
-
addInEdge
void addInEdge(E edge, N node, boolean isSelfLoop)
Addedge
to the set of incoming edges. Implicitly addsnode
as a predecessor.
-
-