Package com.google.common.graph
Class UndirectedGraphConnections<N,V>
java.lang.Object
com.google.common.graph.UndirectedGraphConnections<N,V>
- Type Parameters:
N- Node parameter typeV- Value parameter type
- All Implemented Interfaces:
GraphConnections<N,V>
An implementation of
GraphConnections for undirected graphs.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPredecessor(N node, V value) Addnodeas a predecessor to the origin node.addSuccessor(N node, V value) Addnodeas a successor to the origin node.incidentEdgeIterator(N thisNode) Returns an iterator over the incident edges.(package private) static <N,V> UndirectedGraphConnections<N, V> of(ElementOrder<N> incidentEdgeOrder) (package private) static <N,V> UndirectedGraphConnections<N, V> ofImmutable(Map<N, V> adjacentNodeValues) voidremovePredecessor(N node) Removenodefrom the set of predecessors.removeSuccessor(N node) Removenodefrom the set of successors.Returns the value associated with the edge connecting the origin node tonode, or null if there is no such edge.
-
Field Details
-
adjacentNodeValues
-
-
Constructor Details
-
UndirectedGraphConnections
-
-
Method Details
-
of
-
ofImmutable
-
adjacentNodes
- Specified by:
adjacentNodesin interfaceGraphConnections<N,V>
-
predecessors
- Specified by:
predecessorsin interfaceGraphConnections<N,V>
-
successors
- Specified by:
successorsin interfaceGraphConnections<N,V>
-
incidentEdgeIterator
Description copied from interface:GraphConnectionsReturns an iterator over the incident edges.- Specified by:
incidentEdgeIteratorin interfaceGraphConnections<N,V> - Parameters:
thisNode- The node that this all of the connections in this class are connected to.
-
value
Description copied from interface:GraphConnectionsReturns the value associated with the edge connecting the origin node tonode, or null if there is no such edge.- Specified by:
valuein interfaceGraphConnections<N,V>
-
removePredecessor
Description copied from interface:GraphConnectionsRemovenodefrom the set of predecessors.- Specified by:
removePredecessorin interfaceGraphConnections<N,V>
-
removeSuccessor
Description copied from interface:GraphConnectionsRemovenodefrom the set of successors. Returns the value previously associated with the edge connecting the two nodes.- Specified by:
removeSuccessorin interfaceGraphConnections<N,V>
-
addPredecessor
Description copied from interface:GraphConnectionsAddnodeas 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.- Specified by:
addPredecessorin interfaceGraphConnections<N,V>
-
addSuccessor
Description copied from interface:GraphConnectionsAddnodeas a successor to the origin node. In the case of an undirected graph, it also becomes a predecessor. Associatesvaluewith the edge connecting the two nodes. Returns the value previously associated with the edge connecting the two nodes.- Specified by:
addSuccessorin interfaceGraphConnections<N,V>
-