org.testng.internal
Class Graph<T>
java.lang.Object
org.testng.internal.Graph<T>
public class Graph<T>
- extends java.lang.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
Constructor Summary |
Graph()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Graph
public Graph()
addNode
public void addNode(T tm)
getPredecessors
public java.util.Set<T> getPredecessors(T node)
isIndependent
public boolean isIndependent(T object)
addPredecessor
public void addPredecessor(T tm,
T predecessor)
getNeighbors
public java.util.Set<T> getNeighbors(T t)
getNodeValues
public java.util.Collection<T> getNodeValues()
getIndependentNodes
public java.util.Set<T> getIndependentNodes()
- Returns:
- All the nodes that don't have any order with each other.
getStrictlySortedNodes
public java.util.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 java.util.List<T> findPredecessors(T o)
- Parameters:
o
-
- Returns:
- A list of all the predecessors for o
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
main
public static void main(java.lang.String[] argv)
Copyright © 2010. All Rights Reserved.