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 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.(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) 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.
-
Field Details
-
adjacentNodeValues
-
-
Constructor Details
-
UndirectedGraphConnections
-
-
Method Details
-
of
-
ofImmutable
-
adjacentNodes
- Specified by:
adjacentNodes
in interfaceGraphConnections<N,
V>
-
predecessors
- Specified by:
predecessors
in interfaceGraphConnections<N,
V>
-
successors
- Specified by:
successors
in interfaceGraphConnections<N,
V>
-
incidentEdgeIterator
Description copied from interface:GraphConnections
Returns an iterator over the incident edges.- Specified by:
incidentEdgeIterator
in interfaceGraphConnections<N,
V> - Parameters:
thisNode
- The node that this all of the connections in this class are connected to.
-
value
Description copied from interface:GraphConnections
Returns the value associated with the edge connecting the origin node tonode
, or null if there is no such edge.- Specified by:
value
in interfaceGraphConnections<N,
V>
-
removePredecessor
Description copied from interface:GraphConnections
Removenode
from the set of predecessors.- Specified by:
removePredecessor
in interfaceGraphConnections<N,
V>
-
removeSuccessor
Description copied from interface:GraphConnections
Removenode
from the set of successors. Returns the value previously associated with the edge connecting the two nodes.- Specified by:
removeSuccessor
in interfaceGraphConnections<N,
V>
-
addPredecessor
Description copied from interface:GraphConnections
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.- Specified by:
addPredecessor
in interfaceGraphConnections<N,
V>
-
addSuccessor
Description copied from interface:GraphConnections
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.- Specified by:
addSuccessor
in interfaceGraphConnections<N,
V>
-