org.jikesrvm.compilers.opt.util
Interface TopSortInterface

All Known Implementing Classes:
AnnotatedLSTGraph, CoalesceGraph, ControlFlowGraph, DepGraph, LSTGraph, SpaceEffGraph

public interface TopSortInterface

Interface to allow building top-sort, by calling TopSort.buildTopSort()


Method Summary
 boolean isTopSorted(boolean forward)
          Return true if no resetTopSorted(forward) has been executed since the last setTopSorted(forward) has been executed
 int numberOfNodes()
          Return the number of nodes in the graph
 void resetTopSorted()
          Should have a side effect such that isTopSorted(forward) returns the correct value.
 void setTopSorted(boolean forward)
          Should have a side effect such that isTopSorted(forward) returns the correct value.
 SortedGraphNode startNode(boolean forward)
          Return the start node if forward = true for forward topsort, and return the end node if forward = false for backward topsort.
 

Method Detail

startNode

SortedGraphNode startNode(boolean forward)
Return the start node if forward = true for forward topsort, and return the end node if forward = false for backward topsort.

Parameters:
forward - whether we are viewing the graph in the forward direction
Returns:
the start node if forward = true for forward topsort, the end node if forward = false for backward topsort.

numberOfNodes

int numberOfNodes()
Return the number of nodes in the graph

Returns:
the number of nodes in the graph

isTopSorted

boolean isTopSorted(boolean forward)
Return true if no resetTopSorted(forward) has been executed since the last setTopSorted(forward) has been executed

Parameters:
forward - whether we are viewing the graph in the forward direction
Returns:
true if no resetTopSorted(forward) has been executed since the last setTopSorted(forward) has been executed

setTopSorted

void setTopSorted(boolean forward)
Should have a side effect such that isTopSorted(forward) returns the correct value.

Parameters:
forward - whether we are viewing the graph in the forward direction

resetTopSorted

void resetTopSorted()
Should have a side effect such that isTopSorted(forward) returns the correct value.