Top Description Methods
com.google.common.graph

pack-priv Interface NetworkConnections<N, E>

Known Direct Implementers
com.google.common.graph.AbstractDirectedNetworkConnections, com.google.common.graph.AbstractUndirectedNetworkConnections
Annotations
@ElementTypesAreNonnullByDefault
Type Parameters
<N>
Node parameter type
<E>
Edge parameter type
Imports
com.google.errorprone.annotations.CanIgnoreReturnValue, java.util.Set, javax.annotation.CheckForNull

An interface for representing and manipulating an origin node's adjacent nodes and incident edges in a Network.
Author
James Sexton

Method Summary

Modifier and TypeMethod and Description
public void
addInEdge(E edge, N node, boolean isSelfLoop)

Add edge to the set of incoming edges.

public void
addOutEdge(E edge, N node)

Add edge to the set of outgoing edges.

public N
adjacentNode(E edge)

Returns the node that is adjacent to the origin node along edge.

public Set<N>
public Set<E>
edgesConnecting(N node)

Returns the set of edges connecting the origin node to node.

public Set<E>
public Set<E>
public Set<E>
public Set<N>
public N
removeInEdge(E edge, boolean isSelfLoop)

Remove edge from the set of incoming edges.

public N
removeOutEdge(E edge)

Remove edge from the set of outgoing edges.

public Set<N>

Method Detail

addInEdgeback to summary
public void addInEdge(E edge, N node, boolean isSelfLoop)

Add edge to the set of incoming edges. Implicitly adds node as a predecessor.

addOutEdgeback to summary
public void addOutEdge(E edge, N node)

Add edge to the set of outgoing edges. Implicitly adds node as a successor.

adjacentNodeback to summary
public N adjacentNode(E edge)

Returns the node that is adjacent to the origin node along edge.

In the directed case, edge is assumed to be an outgoing edge.

adjacentNodesback to summary
public Set<N> adjacentNodes()
edgesConnectingback to summary
public Set<E> edgesConnecting(N node)

Returns the set of edges connecting the origin node to node. For networks without parallel edges, this set cannot be of size greater than one.

incidentEdgesback to summary
public Set<E> incidentEdges()
inEdgesback to summary
public Set<E> inEdges()
outEdgesback to summary
public Set<E> outEdges()
predecessorsback to summary
public Set<N> predecessors()
removeInEdgeback to summary
public N removeInEdge(E edge, boolean isSelfLoop)

Remove edge from the set of incoming edges. Returns the former predecessor node.

In the undirected case, returns null if isSelfLoop is true.

Annotations
@CanIgnoreReturnValue
@CheckForNull
removeOutEdgeback to summary
public N removeOutEdge(E edge)

Remove edge from the set of outgoing edges. Returns the former successor node.

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