Package | Description |
---|---|
com.google.common.graph |
An API for representing graph (node and edge) data.
|
Modifier and Type | Class and Description |
---|---|
private static class |
EndpointPair.Ordered<N> |
private static class |
EndpointPair.Unordered<N> |
Modifier and Type | Method and Description |
---|---|
protected EndpointPair<N> |
EndpointPairIterator.Directed.computeNext() |
protected EndpointPair<N> |
EndpointPairIterator.Undirected.computeNext() |
EndpointPair<N> |
StandardNetwork.incidentNodes(E edge) |
EndpointPair<N> |
Network.incidentNodes(E edge)
Returns the nodes which are the endpoints of
edge in this network. |
EndpointPair<N> |
ForwardingNetwork.incidentNodes(E edge) |
EndpointPair<N> |
Graphs.TransposedNetwork.incidentNodes(E edge) |
(package private) static <N> EndpointPair<N> |
EndpointPair.of(Graph<?> graph,
N nodeU,
N nodeV)
Returns an
EndpointPair representing the endpoints of an edge in graph . |
(package private) static <N> EndpointPair<N> |
EndpointPair.of(Network<?,?> network,
N nodeU,
N nodeV)
Returns an
EndpointPair representing the endpoints of an edge in network . |
static <N> EndpointPair<N> |
EndpointPair.ordered(N source,
N target)
Returns an
EndpointPair representing the endpoints of a directed edge. |
(package private) static <N> EndpointPair<N> |
Graphs.transpose(EndpointPair<N> endpoints) |
static <N> EndpointPair<N> |
EndpointPair.unordered(N nodeU,
N nodeV)
Returns an
EndpointPair representing the endpoints of an undirected edge. |
Modifier and Type | Method and Description |
---|---|
private static <N,E> java.util.Map<E,EndpointPair<N>> |
AbstractNetwork.edgeIncidentNodesMap(Network<N,E> network) |
java.util.Set<EndpointPair<N>> |
Graph.edges()
Returns all edges in this graph.
|
java.util.Set<EndpointPair<N>> |
BaseGraph.edges()
Returns all edges in this graph.
|
java.util.Set<EndpointPair<N>> |
ValueGraph.edges()
Returns all edges in this graph.
|
java.util.Set<EndpointPair<N>> |
AbstractBaseGraph.edges()
An implementation of
BaseGraph.edges() defined in terms of BaseGraph.nodes() and BaseGraph.successors(Object) . |
private static <N,V> java.util.Map<EndpointPair<N>,V> |
AbstractValueGraph.edgeValueMap(ValueGraph<N,V> graph) |
java.util.Iterator<EndpointPair<N>> |
UndirectedGraphConnections.incidentEdgeIterator(N thisNode) |
java.util.Iterator<EndpointPair<N>> |
GraphConnections.incidentEdgeIterator(N thisNode)
Returns an iterator over the incident edges.
|
java.util.Iterator<EndpointPair<N>> |
DirectedGraphConnections.incidentEdgeIterator(N thisNode) |
java.util.Set<EndpointPair<N>> |
Graph.incidentEdges(N node)
Returns the edges in this graph whose endpoints include
node . |
java.util.Set<EndpointPair<N>> |
ForwardingGraph.incidentEdges(N node) |
java.util.Set<EndpointPair<N>> |
BaseGraph.incidentEdges(N node)
Returns the edges in this graph whose endpoints include
node . |
java.util.Set<EndpointPair<N>> |
ValueGraph.incidentEdges(N node)
Returns the edges in this graph whose endpoints include
node . |
java.util.Set<EndpointPair<N>> |
StandardValueGraph.incidentEdges(N node) |
java.util.Set<EndpointPair<N>> |
Graphs.TransposedGraph.incidentEdges(N node) |
java.util.Set<EndpointPair<N>> |
AbstractBaseGraph.incidentEdges(N node) |
Modifier and Type | Method and Description |
---|---|
boolean |
MutableNetwork.addEdge(EndpointPair<N> endpoints,
E edge)
Adds
edge connecting endpoints . |
boolean |
StandardMutableNetwork.addEdge(EndpointPair<N> endpoints,
E edge) |
ImmutableNetwork.Builder<N,E> |
ImmutableNetwork.Builder.addEdge(EndpointPair<N> endpoints,
E edge)
Adds
edge connecting endpoints . |
java.util.Optional<E> |
Network.edgeConnecting(EndpointPair<N> endpoints)
Returns the single edge that directly connects
endpoints (in the order, if any,
specified by endpoints ), if one is present, or Optional.empty() if no such edge
exists. |
java.util.Optional<E> |
AbstractNetwork.edgeConnecting(EndpointPair<N> endpoints) |
java.util.Optional<E> |
ForwardingNetwork.edgeConnecting(EndpointPair<N> endpoints) |
java.util.Optional<E> |
Graphs.TransposedNetwork.edgeConnecting(EndpointPair<N> endpoints) |
E |
Network.edgeConnectingOrNull(EndpointPair<N> endpoints)
Returns the single edge that directly connects
endpoints (in the order, if any,
specified by endpoints ), if one is present, or null if no such edge exists. |
E |
AbstractNetwork.edgeConnectingOrNull(EndpointPair<N> endpoints) |
E |
ForwardingNetwork.edgeConnectingOrNull(EndpointPair<N> endpoints) |
E |
Graphs.TransposedNetwork.edgeConnectingOrNull(EndpointPair<N> endpoints) |
java.util.Set<E> |
Network.edgesConnecting(EndpointPair<N> endpoints)
Returns the set of edges that each directly connect
endpoints (in the order, if any,
specified by endpoints ). |
java.util.Set<E> |
AbstractNetwork.edgesConnecting(EndpointPair<N> endpoints) |
java.util.Set<E> |
ForwardingNetwork.edgesConnecting(EndpointPair<N> endpoints) |
java.util.Set<E> |
Graphs.TransposedNetwork.edgesConnecting(EndpointPair<N> endpoints) |
java.util.Optional<V> |
AbstractValueGraph.edgeValue(EndpointPair<N> endpoints) |
java.util.Optional<V> |
ValueGraph.edgeValue(EndpointPair<N> endpoints)
Returns the value of the edge that connects
endpoints (in the order, if any, specified
by endpoints ), if one is present; otherwise, returns Optional.empty() . |
java.util.Optional<V> |
ForwardingValueGraph.edgeValue(EndpointPair<N> endpoints) |
java.util.Optional<V> |
Graphs.TransposedValueGraph.edgeValue(EndpointPair<N> endpoints) |
V |
ValueGraph.edgeValueOrDefault(EndpointPair<N> endpoints,
V defaultValue)
Returns the value of the edge that connects
endpoints (in the order, if any, specified
by endpoints ), if one is present; otherwise, returns defaultValue . |
V |
StandardValueGraph.edgeValueOrDefault(EndpointPair<N> endpoints,
V defaultValue) |
V |
ForwardingValueGraph.edgeValueOrDefault(EndpointPair<N> endpoints,
V defaultValue) |
V |
Graphs.TransposedValueGraph.edgeValueOrDefault(EndpointPair<N> endpoints,
V defaultValue) |
boolean |
Graph.hasEdgeConnecting(EndpointPair<N> endpoints)
Returns true if there is an edge that directly connects
endpoints (in the order, if
any, specified by endpoints ). |
boolean |
Network.hasEdgeConnecting(EndpointPair<N> endpoints)
Returns true if there is an edge that directly connects
endpoints (in the order, if
any, specified by endpoints ). |
boolean |
ForwardingGraph.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
AbstractNetwork.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
BaseGraph.hasEdgeConnecting(EndpointPair<N> endpoints)
Returns true if there is an edge that directly connects
endpoints (in the order, if
any, specified by endpoints ). |
boolean |
ForwardingNetwork.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
ValueGraph.hasEdgeConnecting(EndpointPair<N> endpoints)
Returns true if there is an edge that directly connects
endpoints (in the order, if
any, specified by endpoints ). |
boolean |
StandardValueGraph.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
ForwardingValueGraph.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
Graphs.TransposedGraph.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
Graphs.TransposedValueGraph.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
Graphs.TransposedNetwork.hasEdgeConnecting(EndpointPair<N> endpoints) |
boolean |
AbstractBaseGraph.hasEdgeConnecting(EndpointPair<N> endpoints) |
protected boolean |
AbstractNetwork.isOrderingCompatible(EndpointPair<?> endpoints) |
protected boolean |
AbstractBaseGraph.isOrderingCompatible(EndpointPair<?> endpoints) |
ImmutableGraph.Builder<N> |
ImmutableGraph.Builder.putEdge(EndpointPair<N> endpoints)
Adds an edge connecting
endpoints (in the order, if any, specified by endpoints ) if one is not already present. |
boolean |
MutableGraph.putEdge(EndpointPair<N> endpoints)
Adds an edge connecting
endpoints (in the order, if any, specified by endpoints ) if one is not already present. |
boolean |
StandardMutableGraph.putEdge(EndpointPair<N> endpoints) |
V |
MutableValueGraph.putEdgeValue(EndpointPair<N> endpoints,
V value)
Adds an edge connecting
endpoints if one is not already present, and sets a value for
that edge to value (overwriting the existing value, if any). |
V |
StandardMutableValueGraph.putEdgeValue(EndpointPair<N> endpoints,
V value) |
ImmutableValueGraph.Builder<N,V> |
ImmutableValueGraph.Builder.putEdgeValue(EndpointPair<N> endpoints,
V value)
Adds an edge connecting
endpoints if one is not already present, and sets a value for
that edge to value (overwriting the existing value, if any). |
boolean |
MutableGraph.removeEdge(EndpointPair<N> endpoints)
Removes the edge connecting
endpoints , if it is present. |
V |
MutableValueGraph.removeEdge(EndpointPair<N> endpoints)
Removes the edge connecting
endpoints , if it is present. |
boolean |
StandardMutableGraph.removeEdge(EndpointPair<N> endpoints) |
V |
StandardMutableValueGraph.removeEdge(EndpointPair<N> endpoints) |
(package private) static <N> EndpointPair<N> |
Graphs.transpose(EndpointPair<N> endpoints) |
protected void |
AbstractNetwork.validateEndpoints(EndpointPair<?> endpoints)
Throws an IllegalArgumentException if the ordering of
endpoints is not compatible with
the directionality of this graph. |
protected void |
AbstractBaseGraph.validateEndpoints(EndpointPair<?> endpoints)
Throws
IllegalArgumentException if the ordering of endpoints is not compatible
with the directionality of this graph. |
Modifier and Type | Method and Description |
---|---|
(package private) static <N,V> DirectedGraphConnections<N,V> |
DirectedGraphConnections.ofImmutable(N thisNode,
java.lang.Iterable<EndpointPair<N>> incidentEdges,
Function<N,V> successorNodeToValueFn) |