T - Type of the nodes on the graphpublic class ChangeDirectionsAdapter<T> extends java.lang.Object implements StronglyConnectedComponents.Graph<T>
The new graph has the same set of nodes as the original graph, and for every edge (A,B) from node A to node B in the original graph
| Constructor and Description |
|---|
ChangeDirectionsAdapter(StronglyConnectedComponents.Graph<T> graph,
boolean makeUndirected)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<T> |
getNeighbors(T o)
Obtains, for a node, the set of nodes to which it has an outgoing
edge.
|
java.util.Collection<T> |
getNodes()
Retrieves the set of nodes of the graph.
|
public ChangeDirectionsAdapter(StronglyConnectedComponents.Graph<T> graph, boolean makeUndirected) throws SDMetricsException
graph - The original graph.makeUndirected - Set to true to obtain an undirected
graph, or false to obtain the graph with reversed
edges.SDMetricsException - The neighbors for a node could not be
determinedpublic java.util.Collection<T> getNodes()
StronglyConnectedComponents.GraphgetNodes in interface StronglyConnectedComponents.Graph<T>public java.util.Collection<T> getNeighbors(T o)
StronglyConnectedComponents.GraphgetNeighbors in interface StronglyConnectedComponents.Graph<T>o - The node for which to obtain the neighbor nodes.node
has an outgoing edge.