private static class Graphs.TransposedValueGraph<N,V> extends ForwardingValueGraph<N,V>
| Modifier and Type | Field and Description |
|---|---|
private ValueGraph<N,V> |
graph |
| Constructor and Description |
|---|
TransposedValueGraph(ValueGraph<N,V> graph) |
| Modifier and Type | Method and Description |
|---|---|
protected ValueGraph<N,V> |
delegate() |
java.util.Optional<V> |
edgeValue(N nodeU,
N nodeV)
Returns the value of the edge connecting
nodeU to nodeV, if one is present;
otherwise, returns Optional.empty(). |
V |
edgeValueOrDefault(N nodeU,
N nodeV,
V defaultValue)
Returns the value of the edge connecting
nodeU to nodeV, if one is present;
otherwise, returns defaultValue. |
boolean |
hasEdgeConnecting(N nodeU,
N nodeV)
Returns true if there is an edge directly connecting
nodeU to nodeV. |
int |
inDegree(N node)
Returns the count of
node's incoming edges (equal to predecessors(node).size())
in a directed graph. |
int |
outDegree(N node)
Returns the count of
node's outgoing edges (equal to successors(node).size())
in a directed graph. |
java.util.Set<N> |
predecessors(N node)
Returns all nodes in this graph adjacent to
node which can be reached by traversing
node's incoming edges against the direction (if any) of the edge. |
java.util.Set<N> |
successors(N node)
Returns all nodes in this graph adjacent to
node which can be reached by traversing
node's outgoing edges in the direction (if any) of the edge. |
adjacentNodes, allowsSelfLoops, degree, edgeCount, isDirected, nodeOrder, nodesasGraph, equals, hashCode, toStringedges, incidentEdgesclone, finalize, getClass, notify, notifyAll, wait, wait, waitedges, incidentEdgesprivate final ValueGraph<N,V> graph
TransposedValueGraph(ValueGraph<N,V> graph)
protected ValueGraph<N,V> delegate()
delegate in class ForwardingValueGraph<N,V>public java.util.Set<N> predecessors(N node)
ValueGraphnode which can be reached by traversing
node's incoming edges against the direction (if any) of the edge.
In an undirected graph, this is equivalent to ValueGraph.adjacentNodes(Object).
predecessors in interface BaseGraph<N>predecessors in interface PredecessorsFunction<N>predecessors in interface ValueGraph<N,V>predecessors in class ForwardingValueGraph<N,V>public java.util.Set<N> successors(N node)
ValueGraphnode which can be reached by traversing
node's outgoing edges in the direction (if any) of the edge.
In an undirected graph, this is equivalent to ValueGraph.adjacentNodes(Object).
This is not the same as "all nodes reachable from node by following outgoing
edges". For that functionality, see Graphs.reachableNodes(Graph, Object).
successors in interface BaseGraph<N>successors in interface SuccessorsFunction<N>successors in interface ValueGraph<N,V>successors in class ForwardingValueGraph<N,V>public int inDegree(N node)
BaseGraphnode's incoming edges (equal to predecessors(node).size())
in a directed graph. In an undirected graph, returns the BaseGraph.degree(Object).
If the count is greater than Integer.MAX_VALUE, returns Integer.MAX_VALUE.
public int outDegree(N node)
BaseGraphnode's outgoing edges (equal to successors(node).size())
in a directed graph. In an undirected graph, returns the BaseGraph.degree(Object).
If the count is greater than Integer.MAX_VALUE, returns Integer.MAX_VALUE.
public boolean hasEdgeConnecting(N nodeU, N nodeV)
BaseGraphnodeU to nodeV. This is
equivalent to nodes().contains(nodeU) && successors(nodeU).contains(nodeV).
In an undirected graph, this is equal to hasEdgeConnecting(nodeV, nodeU).
hasEdgeConnecting in interface BaseGraph<N>hasEdgeConnecting in interface ValueGraph<N,V>hasEdgeConnecting in class ForwardingValueGraph<N,V>public java.util.Optional<V> edgeValue(N nodeU, N nodeV)
ValueGraphnodeU to nodeV, if one is present;
otherwise, returns Optional.empty().
In an undirected graph, this is equal to edgeValue(nodeV, nodeU).
edgeValue in interface ValueGraph<N,V>edgeValue in class ForwardingValueGraph<N,V>public V edgeValueOrDefault(N nodeU, N nodeV, V defaultValue)
ValueGraphnodeU to nodeV, if one is present;
otherwise, returns defaultValue.
In an undirected graph, this is equal to edgeValueOrDefault(nodeV, nodeU,
defaultValue).
edgeValueOrDefault in interface ValueGraph<N,V>edgeValueOrDefault in class ForwardingValueGraph<N,V>