Package org.openrewrite
Class Repeat
java.lang.Object
org.openrewrite.Repeat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TreeVisitor<?,ExecutionContext> Returns a new visitor which runs the supplied visitor in a loop until no more changes are made, or a maximum of 3 cycles is reached.static TreeVisitor<?,ExecutionContext> repeatUntilStable(TreeVisitor<?, ExecutionContext> v, int maxCycles) Returns a new visitor which runs the supplied visitor in a loop until no more changes are made, or the maximum number of cycles is reached.
-
Constructor Details
-
Repeat
public Repeat()
-
-
Method Details
-
repeatUntilStable
Returns a new visitor which runs the supplied visitor in a loop until no more changes are made, or a maximum of 3 cycles is reached. Convenient when a visitor is designed to recursively apply itself to a tree to achieve its desired result. Stops early if the visitor ceases to make changes to the tree before the maximum number of cycles is reached. -
repeatUntilStable
public static TreeVisitor<?,ExecutionContext> repeatUntilStable(TreeVisitor<?, ExecutionContext> v, int maxCycles) Returns a new visitor which runs the supplied visitor in a loop until no more changes are made, or the maximum number of cycles is reached. Convenient when a visitor is designed to recursively apply itself to a tree to achieve its desired result. Stops early if the visitor ceases to make changes to the tree before the maximum number of cycles is reached.
-