Class RuleApplicationTrace


  • public class RuleApplicationTrace
    extends java.lang.Object
    Keeps a trace of applied rules (and also failures)
    Author:
    Lorenzo Bettini
    • Field Detail

      • trace

        protected java.util.List<java.lang.Object> trace
    • Constructor Detail

      • RuleApplicationTrace

        public RuleApplicationTrace()
    • Method Detail

      • addToTrace

        public void addToTrace​(java.lang.Object traceElement)
      • 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., InstantiationException or IllegalAccessException, 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