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 voidaddInEdge(E edge, N node, boolean isSelfLoop)Addedgeto the set of incoming edges.voidaddOutEdge(E edge, N node)Addedgeto the set of outgoing edges.NadjacentNode(E edge)Returns the node that is adjacent to the origin node alongedge.java.util.Set<N>adjacentNodes()java.util.Set<E>edgesConnecting(N node)Returns the set of edges connecting the origin node tonode.java.util.Set<E>incidentEdges()java.util.Set<E>inEdges()java.util.Set<E>outEdges()java.util.Set<N>predecessors()NremoveInEdge(E edge, boolean isSelfLoop)Removeedgefrom the set of incoming edges.NremoveOutEdge(E edge)Removeedgefrom 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(N 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.
-
adjacentNode
N adjacentNode(E edge)
Returns the node that is adjacent to the origin node alongedge.In the directed case,
edgeis assumed to be an outgoing edge.
-
removeInEdge
N removeInEdge(E edge, boolean isSelfLoop)
Removeedgefrom the set of incoming edges. Returns the former predecessor node.In the undirected case, returns
nullifisSelfLoopis true.
-
removeOutEdge
N removeOutEdge(E edge)
Removeedgefrom the set of outgoing edges. Returns the former successor node.
-
addInEdge
void addInEdge(E edge, N node, boolean isSelfLoop)
Addedgeto the set of incoming edges. Implicitly addsnodeas a predecessor.
-
-