Package com.google.common.graph
Interface GraphConnections<N,V>
- Type Parameters:
N
- Node parameter typeV
- Value parameter type
- All Known Implementing Classes:
DirectedGraphConnections
,UndirectedGraphConnections
interface GraphConnections<N,V>
An interface for representing and manipulating an origin node's adjacent nodes and edge values in
a
Graph
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPredecessor
(N node, V value) Addnode
as a predecessor to the origin node.addSuccessor
(N node, V value) Addnode
as a successor to the origin node.incidentEdgeIterator
(N thisNode) Returns an iterator over the incident edges.void
removePredecessor
(N node) Removenode
from the set of predecessors.removeSuccessor
(N node) Removenode
from the set of successors.Returns the value associated with the edge connecting the origin node tonode
, or null if there is no such edge.
-
Method Details
-
adjacentNodes
-
predecessors
-
successors
-
incidentEdgeIterator
Returns an iterator over the incident edges.- Parameters:
thisNode
- The node that this all of the connections in this class are connected to.
-
value
Returns the value associated with the edge connecting the origin node tonode
, or null if there is no such edge. -
removePredecessor
Removenode
from the set of predecessors. -
removeSuccessor
Removenode
from the set of successors. Returns the value previously associated with the edge connecting the two nodes. -
addPredecessor
Addnode
as a predecessor to the origin node. In the case of an undirected graph, it also becomes a successor. Associatesvalue
with the edge connecting the two nodes. -
addSuccessor
Addnode
as a successor to the origin node. In the case of an undirected graph, it also becomes a predecessor. Associatesvalue
with the edge connecting the two nodes. Returns the value previously associated with the edge connecting the two nodes.
-