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

pack-priv abstract Class AbstractDirectedNetworkConnections<N, E>

extends Object
implements NetworkConnections<N, E>
Class Inheritance
All Implemented Interfaces
com.google.common.graph.NetworkConnections
Known Direct Subclasses
com.google.common.graph.DirectedMultiNetworkConnections, com.google.common.graph.DirectedNetworkConnections
Annotations
@ElementTypesAreNonnullByDefault
Type Parameters
<N>
Node parameter type
<E>
Edge parameter type
Static Imports
com.google.common.base.Preconditions.checkNotNull, .Preconditions.checkState, com.google.common.graph.Graphs.checkNonNegative, .Graphs.checkPositive, java.util.Objects.requireNonNull

A base implementation of NetworkConnections for directed networks.
Author
James Sexton

Field Summary

Modifier and TypeField and Description
pack-priv final Map<E, N>
inEdgeMap

Keys are edges incoming to the origin node, values are the source node.

pack-priv final Map<E, N>
outEdgeMap

Keys are edges outgoing from the origin node, values are the target node.

private int

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractDirectedNetworkConnections(Map<E, N> inEdgeMap, Map<E, N> outEdgeMap, int selfLoopCount)

Method Summary

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

Implements com.google.common.graph.NetworkConnections.addInEdge.

Add edge to the set of incoming edges.
public void
addOutEdge(E edge, N node)

Implements com.google.common.graph.NetworkConnections.addOutEdge.

Add edge to the set of outgoing edges.
public N
adjacentNode(E edge)

Implements com.google.common.graph.NetworkConnections.adjacentNode.

Returns the node that is adjacent to the origin node along edge.
public Set<N>
public Set<E>
public Set<E>
public Set<E>
public N
removeInEdge(E edge, boolean isSelfLoop)

Implements com.google.common.graph.NetworkConnections.removeInEdge.

Remove edge from the set of incoming edges.
public N
removeOutEdge(E edge)

Implements com.google.common.graph.NetworkConnections.removeOutEdge.

Remove edge from the set of outgoing edges.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inEdgeMapback to summary
pack-priv final Map<E, N> inEdgeMap

Keys are edges incoming to the origin node, values are the source node.

outEdgeMapback to summary
pack-priv final Map<E, N> outEdgeMap

Keys are edges outgoing from the origin node, values are the target node.

selfLoopCountback to summary
private int selfLoopCount

Constructor Detail

AbstractDirectedNetworkConnectionsback to summary
pack-priv AbstractDirectedNetworkConnections(Map<E, N> inEdgeMap, Map<E, N> outEdgeMap, int selfLoopCount)

Method Detail

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

Implements com.google.common.graph.NetworkConnections.addInEdge.

Doc from com.google.common.graph.NetworkConnections.addInEdge.

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

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

Implements com.google.common.graph.NetworkConnections.addOutEdge.

Doc from com.google.common.graph.NetworkConnections.addOutEdge.

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

Annotations
@Override
adjacentNodeback to summary
public N adjacentNode(E edge)

Implements com.google.common.graph.NetworkConnections.adjacentNode.

Doc from com.google.common.graph.NetworkConnections.adjacentNode.

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

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

Annotations
@Override
adjacentNodesback to summary
public Set<N> adjacentNodes()

Implements com.google.common.graph.NetworkConnections.adjacentNodes.

Annotations
@Override
incidentEdgesback to summary
public Set<E> incidentEdges()

Implements com.google.common.graph.NetworkConnections.incidentEdges.

Annotations
@Override
inEdgesback to summary
public Set<E> inEdges()

Implements com.google.common.graph.NetworkConnections.inEdges.

Annotations
@Override
outEdgesback to summary
public Set<E> outEdges()

Implements com.google.common.graph.NetworkConnections.outEdges.

Annotations
@Override
removeInEdgeback to summary
public N removeInEdge(E edge, boolean isSelfLoop)

Implements com.google.common.graph.NetworkConnections.removeInEdge.

Doc from com.google.common.graph.NetworkConnections.removeInEdge.

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

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

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

Implements com.google.common.graph.NetworkConnections.removeOutEdge.

Doc from com.google.common.graph.NetworkConnections.removeOutEdge.

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

Annotations
@Override