Top Description Fields Constructors Methods
com.google.common.graph

pack-priv final Class UndirectedGraphConnections<N, V>

extends Object
implements GraphConnections<N, V>
Class Inheritance
All Implemented Interfaces
com.google.common.graph.GraphConnections
Annotations
@ElementTypesAreNonnullByDefault
Type Parameters
<N>
Node parameter type
<V>
Value parameter type
Static Imports
com.google.common.base.Preconditions.checkNotNull, com.google.common.graph.GraphConstants.INNER_CAPACITY, .GraphConstants.INNER_LOAD_FACTOR

An implementation of GraphConnections for undirected graphs.
Author
James Sexton

Field Summary

Modifier and TypeField and Description
private final Map<N, V>

Constructor Summary

AccessConstructor and Description
private
UndirectedGraphConnections(Map<N, V> adjacentNodeValues)

Method Summary

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

Implements com.google.common.graph.GraphConnections.addPredecessor.

Add node as a predecessor to the origin node.
public V
addSuccessor(N node, V value)

Implements com.google.common.graph.GraphConnections.addSuccessor.

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
)

Implements com.google.common.graph.GraphConnections.incidentEdgeIterator.

Returns an iterator over the incident edges.
pack-priv static <N, V> UndirectedGraphConnections<N, V>
of(ElementOrder<N> incidentEdgeOrder)

pack-priv static <N, V> UndirectedGraphConnections<N, V>
ofImmutable(Map<N, V> adjacentNodeValues)

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

Implements com.google.common.graph.GraphConnections.removePredecessor.

Remove node from the set of predecessors.
public V
removeSuccessor(N node)

Implements com.google.common.graph.GraphConnections.removeSuccessor.

Remove node from the set of successors.
public Set<N>
public V
value(N node)

Implements com.google.common.graph.GraphConnections.value.

Returns the value associated with the edge connecting the origin node to node, or null if there is no such edge.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adjacentNodeValuesback to summary
private final Map<N, V> adjacentNodeValues

Constructor Detail

UndirectedGraphConnectionsback to summary
private UndirectedGraphConnections(Map<N, V> adjacentNodeValues)

Method Detail

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

Implements com.google.common.graph.GraphConnections.addPredecessor.

Doc from com.google.common.graph.GraphConnections.addPredecessor.

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.

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

Implements com.google.common.graph.GraphConnections.addSuccessor.

Doc from com.google.common.graph.GraphConnections.addSuccessor.

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
@Override
@CheckForNull
adjacentNodesback to summary
public Set<N> adjacentNodes()

Implements com.google.common.graph.GraphConnections.adjacentNodes.

Annotations
@Override
incidentEdgeIteratorback to summary
public Iterator<EndpointPair<N>> incidentEdgeIterator(N thisNode)

Implements com.google.common.graph.GraphConnections.incidentEdgeIterator.

Doc from com.google.common.graph.GraphConnections.incidentEdgeIterator.

Returns an iterator over the incident edges.

Parameters
thisNode:N

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

Annotations
@Override
ofback to summary
pack-priv static <N, V> UndirectedGraphConnections<N, V> of(ElementOrder<N> incidentEdgeOrder)
ofImmutableback to summary
pack-priv static <N, V> UndirectedGraphConnections<N, V> ofImmutable(Map<N, V> adjacentNodeValues)
predecessorsback to summary
public Set<N> predecessors()

Implements com.google.common.graph.GraphConnections.predecessors.

Annotations
@Override
removePredecessorback to summary
public void removePredecessor(N node)

Implements com.google.common.graph.GraphConnections.removePredecessor.

Doc from com.google.common.graph.GraphConnections.removePredecessor.

Remove node from the set of predecessors.

Annotations
@Override
removeSuccessorback to summary
public V removeSuccessor(N node)

Implements com.google.common.graph.GraphConnections.removeSuccessor.

Doc from com.google.common.graph.GraphConnections.removeSuccessor.

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

Annotations
@Override
@CheckForNull
successorsback to summary
public Set<N> successors()

Implements com.google.common.graph.GraphConnections.successors.

Annotations
@Override
valueback to summary
public V value(N node)

Implements com.google.common.graph.GraphConnections.value.

Doc from com.google.common.graph.GraphConnections.value.

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

Annotations
@Override
@CheckForNull