private static class Graphs.TransposedGraph<N> extends ForwardingGraph<N>
Constructor and Description |
---|
TransposedGraph(Graph<N> graph) |
Modifier and Type | Method and Description |
---|---|
protected Graph<N> |
delegate() |
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, nodes
equals, hashCode, toString
edges, incidentEdges
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
edges, incidentEdges
protected Graph<N> delegate()
delegate
in class ForwardingGraph<N>
public java.util.Set<N> predecessors(N node)
Graph
node
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 Graph.adjacentNodes(Object)
.
predecessors
in interface BaseGraph<N>
predecessors
in interface Graph<N>
predecessors
in interface PredecessorsFunction<N>
predecessors
in class ForwardingGraph<N>
public java.util.Set<N> successors(N node)
Graph
node
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 Graph.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 Graph<N>
successors
in interface SuccessorsFunction<N>
successors
in class ForwardingGraph<N>
public int inDegree(N node)
BaseGraph
node
'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)
BaseGraph
node
'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)
BaseGraph
nodeU
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 Graph<N>
hasEdgeConnecting
in class ForwardingGraph<N>