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
  • Constructor Details

  • Method Details

    • addNode

      public void addNode(T tm)
    • getPredecessors

      public Set<T> getPredecessors(T node)
    • isIndependent

      public boolean isIndependent(T object)
    • addPredecessor

      public void addPredecessor(T tm, T predecessor)
    • 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 - - The predecessor
      Returns:
      A list of all the predecessors for o
    • toString

      public String toString()
      Overrides:
      toString in class Object