Top Description Methods
com.google.common.graph

pack-priv Interface GraphConnections<N, V>

Known Direct Implementers
com.google.common.graph.UndirectedGraphConnections, com.google.common.graph.DirectedGraphConnections
Annotations
@ElementTypesAreNonnullByDefault
Type Parameters
<N>
Node parameter type
<V>
Value parameter type
Imports
com.google.errorprone.annotations.CanIgnoreReturnValue, java.util.Iterator, .Set, javax.annotation.CheckForNull

An interface for representing and manipulating an origin node's adjacent nodes and edge values in a Graph.
Author
James Sexton

Method Summary

Modifier and TypeMethod and Description
public void
addPredecessor(N node, V value)

Add node as a predecessor to the origin node.

public V
addSuccessor(N node, V value)

Add node as a successor to the origin node.

public Set<N>
public Iterator<EndpointPair<N>>
incidentEdgeIterator(N
The node that this all of the connections in this class are connected to.
thisNode
)

Returns an iterator over the incident edges.

public Set<N>
public void
removePredecessor(N node)

Remove node from the set of predecessors.

public V
removeSuccessor(N node)

Remove node from the set of successors.

public Set<N>
public V
value(N node)

Returns the value associated with the edge connecting the origin node to node, or null if there is no such edge.

Method Detail

addPredecessorback to summary
public void addPredecessor(N node, V value)

Add node as a predecessor to the origin node. In the case of an undirected graph, it also becomes a successor. Associates value with the edge connecting the two nodes.

addSuccessorback to summary
public V addSuccessor(N node, V value)

Add node as a successor to the origin node. In the case of an undirected graph, it also becomes a predecessor. Associates value with the edge connecting the two nodes. Returns the value previously associated with the edge connecting the two nodes.

Annotations
@CanIgnoreReturnValue
@CheckForNull
adjacentNodesback to summary
public Set<N> adjacentNodes()
incidentEdgeIteratorback to summary
public Iterator<EndpointPair<N>> incidentEdgeIterator(N thisNode)

Returns an iterator over the incident edges.

Parameters
thisNode:N

The node that this all of the connections in this class are connected to.

predecessorsback to summary
public Set<N> predecessors()
removePredecessorback to summary
public void removePredecessor(N node)

Remove node from the set of predecessors.

removeSuccessorback to summary
public V removeSuccessor(N node)

Remove node from the set of successors. Returns the value previously associated with the edge connecting the two nodes.

Annotations
@CanIgnoreReturnValue
@CheckForNull
successorsback to summary
public Set<N> successors()
valueback to summary
public V value(N node)

Returns the value associated with the edge connecting the origin node to node, or null if there is no such edge.

Annotations
@CheckForNull