Class RecursionGuard<T>
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.util.RecursionGuard<T>
-
public class RecursionGuard<T> extends java.lang.Object
A simple guard against infinite recursion. Can be used as a stack or a sink. It uses identity comparison to detect recursion. It is designed to cause minimal overhead for recursive structures that are not deeper than approx 15 elements and has less elements in the average case.
-
-
Constructor Summary
Constructors Constructor Description RecursionGuard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
done(T element)
boolean
tryNext(T element)
-