Package org.testng.internal
Class Graph<T>
- java.lang.Object
-
- org.testng.internal.Graph<T>
-
public class Graph<T> extends Object
Simple graph class to implement topological sort (used to sort methods based on what groups they depend on).- Author:
- Cedric Beust, Aug 19, 2004
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGraph.Node<T>
-
Constructor Summary
Constructors Constructor Description Graph(Comparator<Graph.Node<T>> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(T tm)voidaddPredecessor(T tm, T predecessor)List<T>findPredecessors(T o)Set<T>getIndependentNodes()Set<T>getNeighbors(T t)Collection<T>getNodeValues()Set<T>getPredecessors(T node)List<T>getStrictlySortedNodes()booleanisIndependent(T object)voidtopologicalSort()StringtoString()
-
-
-
Constructor Detail
-
Graph
public Graph(Comparator<Graph.Node<T>> comparator)
-
-
Method Detail
-
addNode
public void addNode(T tm)
-
isIndependent
public boolean isIndependent(T object)
-
getNodeValues
public Collection<T> getNodeValues()
-
getIndependentNodes
public Set<T> getIndependentNodes()
- Returns:
- All the nodes that don't have any order with each other.
-
getStrictlySortedNodes
public List<T> getStrictlySortedNodes()
- Returns:
- All the nodes that have an order with each other, sorted in one of the valid sorts.
-
topologicalSort
public void topologicalSort()
-
findPredecessors
public List<T> findPredecessors(T o)
- Parameters:
o-- Returns:
- A list of all the predecessors for o
-
-