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 aGraph.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPredecessor(N node, V value)Addnodeas a predecessor to the origin node.VaddSuccessor(N node, V value)Addnodeas a successor to the origin node.java.util.Set<N>adjacentNodes()java.util.Iterator<EndpointPair<N>>incidentEdgeIterator(N thisNode)Returns an iterator over the incident edges.java.util.Set<N>predecessors()voidremovePredecessor(N node)Removenodefrom the set of predecessors.VremoveSuccessor(N node)Removenodefrom the set of successors.java.util.Set<N>successors()Vvalue(N node)Returns the value associated with the edge connecting the origin node tonode, or null if there is no such edge.
-
-
-
Method Detail
-
adjacentNodes
java.util.Set<N> adjacentNodes()
-
predecessors
java.util.Set<N> predecessors()
-
successors
java.util.Set<N> successors()
-
incidentEdgeIterator
java.util.Iterator<EndpointPair<N>> incidentEdgeIterator(N thisNode)
Returns an iterator over the incident edges.- Parameters:
thisNode- The node that this all of the connections in this class are connected to.
-
value
V value(N node)
Returns the value associated with the edge connecting the origin node tonode, or null if there is no such edge.
-
removePredecessor
void removePredecessor(N node)
Removenodefrom the set of predecessors.
-
removeSuccessor
V removeSuccessor(N node)
Removenodefrom the set of successors. Returns the value previously associated with the edge connecting the two nodes.
-
addPredecessor
void addPredecessor(N node, V value)
Addnodeas a predecessor to the origin node. In the case of an undirected graph, it also becomes a successor. Associatesvaluewith the edge connecting the two nodes.
-
-