Class FixedPointGraphTraversal<N,E>
- java.lang.Object
-
- com.google.javascript.jscomp.graph.FixedPointGraphTraversal<N,E>
-
- Type Parameters:
N
- Value type that the graph node stores.E
- Value type that the graph edge stores.
public final class FixedPointGraphTraversal<N,E> extends java.lang.Object
A utility class for doing fixed-point computations. We traverse the edges over the given directed graph until the graph reaches a steady state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FixedPointGraphTraversal.EdgeCallback<NodeT,EdgeT>
Edge callback
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NON_HALTING_ERROR_MSG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeFixedPoint(DiGraph<N,E> graph)
Compute a fixed point for the given graph.void
computeFixedPoint(DiGraph<N,E> graph, java.util.Set<N> entrySet)
Compute a fixed point for the given graph, entering from the given nodes.void
computeFixedPoint(DiGraph<N,E> graph, N entry)
Compute a fixed point for the given graph, entering from the given node.static <NodeT,EdgeT>
FixedPointGraphTraversal<NodeT,EdgeT>newReverseTraversal(FixedPointGraphTraversal.EdgeCallback<NodeT,EdgeT> callback)
Helper method for creating new traversals that traverse from child to parent.static <NodeT,EdgeT>
FixedPointGraphTraversal<NodeT,EdgeT>newTraversal(FixedPointGraphTraversal.EdgeCallback<NodeT,EdgeT> callback)
Helper method for creating new traversals that traverse from parent to child.
-
-
-
Field Detail
-
NON_HALTING_ERROR_MSG
public static final java.lang.String NON_HALTING_ERROR_MSG
- See Also:
- Constant Field Values
-
-
Method Detail
-
newTraversal
public static <NodeT,EdgeT> FixedPointGraphTraversal<NodeT,EdgeT> newTraversal(FixedPointGraphTraversal.EdgeCallback<NodeT,EdgeT> callback)
Helper method for creating new traversals that traverse from parent to child.
-
newReverseTraversal
public static <NodeT,EdgeT> FixedPointGraphTraversal<NodeT,EdgeT> newReverseTraversal(FixedPointGraphTraversal.EdgeCallback<NodeT,EdgeT> callback)
Helper method for creating new traversals that traverse from child to parent.
-
computeFixedPoint
public void computeFixedPoint(DiGraph<N,E> graph)
Compute a fixed point for the given graph.- Parameters:
graph
- The graph to traverse.
-
computeFixedPoint
public void computeFixedPoint(DiGraph<N,E> graph, N entry)
Compute a fixed point for the given graph, entering from the given node.- Parameters:
graph
- The graph to traverse.entry
- The node to begin traversing from.
-
-