Package edu.umd.cs.findbugs.graph
Class Transpose<GraphType extends Graph<EdgeType,VertexType>,EdgeType extends GraphEdge<EdgeType,VertexType>,VertexType extends GraphVertex<VertexType>>
java.lang.Object
edu.umd.cs.findbugs.graph.Transpose<GraphType,EdgeType,VertexType>
public class Transpose<GraphType extends Graph<EdgeType,VertexType>,EdgeType extends GraphEdge<EdgeType,VertexType>,VertexType extends GraphVertex<VertexType>>
extends Object
Algorithm to transpose a graph.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentityHashMap
<VertexType, VertexType> private final IdentityHashMap
<VertexType, VertexType> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the vertex in the original graph which corresponds to the given vertex in the transposed graph.Get the vertex in the transposed graph which corresponds to the given vertex in the original graph.transpose
(GraphType orig, GraphToolkit<GraphType, EdgeType, VertexType> toolkit) Transpose a graph.
-
Field Details
-
m_origToTransposeMap
private final IdentityHashMap<VertexType extends GraphVertex<VertexType>,VertexType extends GraphVertex<VertexType>> m_origToTransposeMap -
m_transposeToOrigMap
private final IdentityHashMap<VertexType extends GraphVertex<VertexType>,VertexType extends GraphVertex<VertexType>> m_transposeToOrigMap
-
-
Constructor Details
-
Transpose
public Transpose()Constructor.
-
-
Method Details
-
transpose
Transpose a graph. Note that the original graph is not modified; the new graph and its vertices and edges are new objects.- Parameters:
orig
- the graph to transposetoolkit
- a GraphToolkit to be used to create the transposed Graph- Returns:
- the transposed Graph
-
getTransposedGraphVertex
Get the vertex in the transposed graph which corresponds to the given vertex in the original graph.- Parameters:
v
- the vertex in the original graph- Returns:
- the equivalent vertex in the transposed graph
-
getOriginalGraphVertex
Get the vertex in the original graph which corresponds to the given vertex in the transposed graph.- Parameters:
v
- the vertex in the transposed graph- Returns:
- the equivalent vertex in the original graph
-