Package org.eclipse.xsemantics.runtime
Class RuleApplicationTrace
- java.lang.Object
-
- org.eclipse.xsemantics.runtime.RuleApplicationTrace
-
public class RuleApplicationTrace extends java.lang.ObjectKeeps a trace of applied rules (and also failures)- Author:
- Lorenzo Bettini
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.Object>trace
-
Constructor Summary
Constructors Constructor Description RuleApplicationTrace()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAsSubtrace(RuleApplicationTrace subTrace)voidaddObjectAsSubtrace(java.lang.Object traceElement)voidaddToTrace(java.lang.Object traceElement)java.util.List<java.lang.Object>getTrace()booleanisEmpty()protected RuleApplicationTraceperformSafeDeepCloning()RuleApplicationTracesnapshot()Returns a "snapshot" of the current trace (i.e., it partially deeply clones possible subtraces); this is useful for storing snapshots in cached computations.
-
-
-
Method Detail
-
addToTrace
public void addToTrace(java.lang.Object traceElement)
-
addAsSubtrace
public void addAsSubtrace(RuleApplicationTrace subTrace)
-
addObjectAsSubtrace
public void addObjectAsSubtrace(java.lang.Object traceElement)
- Since:
- 1.5
-
getTrace
public java.util.List<java.lang.Object> getTrace()
-
isEmpty
public boolean isEmpty()
- Since:
- 1.5
-
snapshot
public RuleApplicationTrace snapshot()
Returns a "snapshot" of the current trace (i.e., it partially deeply clones possible subtraces); this is useful for storing snapshots in cached computations. If there are instantiation exceptions during the deep cloning of a RuleApplicationTrace, e.g.,InstantiationExceptionorIllegalAccessException, the clone gracefully falls back to the very same instance. Note that only possibly nested RuleApplicationTrace instances are cloned, not the other objects of the trace, i.e., strings are not cloned.- Since:
- 1.5
-
performSafeDeepCloning
protected RuleApplicationTrace performSafeDeepCloning()
- Since:
- 1.6
-
-