Package | Description |
---|---|
com.google.common.graph |
An API for representing graph (node and edge) data.
|
Modifier and Type | Method and Description |
---|---|
EndpointPair<N> |
Network.incidentNodes(E edge)
Returns the nodes which are the endpoints of
edge in this network. |
static <N> EndpointPair<N> |
EndpointPair.ordered(N source,
N target)
Returns an
EndpointPair representing the endpoints of a directed edge. |
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 |
---|---|
Set<EndpointPair<N>> |
Graph.edges()
Returns all edges in this graph.
|
Set<EndpointPair<N>> |
ValueGraph.edges()
Returns all edges in this graph.
|
Set<EndpointPair<N>> |
Graph.incidentEdges(N node)
Returns the edges in this graph whose endpoints include
node . |
Set<EndpointPair<N>> |
ValueGraph.incidentEdges(N node)
Returns the edges in this graph whose endpoints include
node . |
Modifier and Type | Method and Description |
---|---|
boolean |
MutableNetwork.addEdge(EndpointPair<N> endpoints,
E edge)
Adds
edge connecting endpoints . |
ImmutableNetwork.Builder<N,E> |
ImmutableNetwork.Builder.addEdge(EndpointPair<N> endpoints,
E edge)
Adds
edge connecting endpoints . |
Optional<E> |
AbstractNetwork.edgeConnecting(EndpointPair<N> endpoints) |
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. |
E |
AbstractNetwork.edgeConnectingOrNull(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. |
Set<E> |
AbstractNetwork.edgesConnecting(EndpointPair<N> endpoints) |
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 ). |
Optional<V> |
AbstractValueGraph.edgeValue(EndpointPair<N> endpoints) |
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() . |
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 . |
boolean |
AbstractNetwork.hasEdgeConnecting(EndpointPair<N> endpoints) |
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 |
ValueGraph.hasEdgeConnecting(EndpointPair<N> endpoints)
Returns true if there is an edge that directly connects
endpoints (in the order, if
any, specified by endpoints ). |
protected boolean |
AbstractNetwork.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. |
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). |
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). |
V |
MutableValueGraph.removeEdge(EndpointPair<N> endpoints)
Removes the edge connecting
endpoints , if it is present. |
boolean |
MutableGraph.removeEdge(EndpointPair<N> endpoints)
Removes the edge connecting
endpoints , if it is present. |
protected void |
AbstractNetwork.validateEndpoints(EndpointPair<?> endpoints)
Throws an IllegalArgumentException if the ordering of
endpoints is not compatible with
the directionality of this graph. |
Copyright © 2010–2020. All rights reserved.