Class AccumulatorRule

    • Constructor Detail

      • AccumulatorRule

        public AccumulatorRule​(Expression newValueExpression,
                               SlotManager stackFrameMap,
                               boolean postDescent)
        Create a rule
        Parameters:
        newValueExpression - the expression that computes a new value of the accumulator function
        stackFrameMap - the stack frame used to evaluate this expression
        postDescent - true if this is a post-descent rule, false for a pre-descent rule
    • Method Detail

      • getNewValueExpression

        public Expression getNewValueExpression()
      • getStackFrameMap

        public SlotManager getStackFrameMap()
      • registerRule

        public void registerRule​(Rule rule)
        Register a rule for which this is the target
        Specified by:
        registerRule in interface RuleTarget
        Parameters:
        rule - a rule in which this is the target
      • setCapturing

        public void setCapturing​(boolean capturing)
      • isCapturing

        public boolean isCapturing()
      • isPostDescent

        public boolean isPostDescent()
      • getBody

        public Expression getBody()
        Description copied from interface: TraceableComponent
        Get the expression at the root of the expression tree used to evaluate this construct
        Specified by:
        getBody in interface TraceableComponent
        Returns:
        the root expression
      • setLocation

        public void setLocation​(Location loc)
      • getLocation

        public Location getLocation()
        Description copied from interface: Locatable
        Get the location of the construct
        Specified by:
        getLocation in interface Locatable
        Returns:
        the location. If no location information is available, the method should return Loc.NONE rather than returning null. However, callers would be well advised to check for the result being null.
      • getObjectName

        public StructuredQName getObjectName()
        Description copied from interface: Traceable
        Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically.
        Specified by:
        getObjectName in interface Traceable
        Returns:
        the QName of the object declared or manipulated by this instruction or expression
      • setBody

        public void setBody​(Expression expression)
        Description copied from interface: TraceableComponent
        Set the expression to be used to evaluate this construct
        Specified by:
        setBody in interface TraceableComponent
        Parameters:
        expression - the evaluation expression
      • setAccumulatorName

        public void setAccumulatorName​(StructuredQName name)
      • gatherProperties

        public void gatherProperties​(BiConsumer<String,​Object> consumer)
        Description copied from interface: Traceable
        Get the properties of this object to be included in trace messages, by supplying the property values to a supplied consumer function
        Specified by:
        gatherProperties in interface Traceable
        Parameters:
        consumer - the function to which the properties should be supplied, as (property name, value) pairs.