Interface BaseTopologicalOrderGraph
- All Known Subinterfaces:
TopologicalOrderGraph
- All Known Implementing Classes:
DefaultTopologicalOrderGraph
public interface BaseTopologicalOrderGraph
Exists to expose read-only view of
TopologicalOrderGraph.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordStores a graph node id along its topological order. -
Method Summary
Modifier and TypeMethodDescriptiongetTopologicalOrder(int node) Returns a tuple containing node ID and a number corresponding to its topological order.booleanisLooped(LoopedTracker loopedTracker, int node) Returns true if a given node is in a strongly connected component with a size greater than 1 (i.e. is in a loop) or is a transitive successor of a node with the above property.nodeForwardEdges(int from) Return an iterator of the nodes that have the `from` node as a predecessor.
-
Method Details
-
nodeForwardEdges
Return an iterator of the nodes that have the `from` node as a predecessor.- Parameters:
from- The predecessor node.- Returns:
- an iterator of nodes with from as a predecessor.
-
isLooped
Returns true if a given node is in a strongly connected component with a size greater than 1 (i.e. is in a loop) or is a transitive successor of a node with the above property.- Parameters:
loopedTracker- a tracker that can be used to record looped state to avoid recomputation.node- The node being queried- Returns:
- true if `node` is in a loop, false otherwise.
-
getTopologicalOrder
Returns a tuple containing node ID and a number corresponding to its topological order. In particular, afterTopologicalOrderGraph.commitChanges(java.util.BitSet)is called, the following must be true for any pair of nodes A, B where:- A is a predecessor of B
- `isLooped(A) == isLooped(B) == false`
Said number may not be unique.
-