Class BuildEnablingApplicator


  • public class BuildEnablingApplicator
    extends Applicator
    An applicator which may enable the execution of a loop body. This applicator collects whether all conditions have at least one LHS/RHS match requiring a build. To be efficient, this applicator stops the loops as soon as possible.
    Author:
    Holger Eichelberger
    • Field Detail

      • lhsRhsBuildMatchFound

        private boolean lhsRhsBuildMatchFound
      • allConditionsEnabled

        private boolean allConditionsEnabled
    • Constructor Detail

      • BuildEnablingApplicator

        public BuildEnablingApplicator()
    • Method Detail

      • apply

        public void apply​(java.lang.Object expectedLhsValue,
                          java.lang.Object rhsValue,
                          int index)
                   throws VilException
        Description copied from class: Applicator
        Apply this applicator for one combination which requires building. This may be due to the fact that rhsValue
        • is newer than expectedLhsValue
        • exists but expectedLhsValue does not exist
        • exists but no LHS is specified (expectedLhsValue is null)
        Specified by:
        apply in class Applicator
        Parameters:
        expectedLhsValue - the expected result after building rhsValue (may be null)
        rhsValue - the value determined for the right side as part of a match
        index - the 0-based index of the RHS match condition in the specifying rule (Applicator.getElementCount()
        Throws:
        VilException - in case that executing parts of a rule or setting variable values fails
      • stopMatchLoop

        public boolean stopMatchLoop()
        Description copied from class: Applicator
        Enables a pre-exit of the match loop.
        Overrides:
        stopMatchLoop in class Applicator
        Returns:
        true if the match loop shall exit before the next iteration, false if the loop shall continue (default)
      • stopConditionLoop

        public boolean stopConditionLoop()
        Description copied from class: Applicator
        Enables a pre-exit of the condition loop.
        Overrides:
        stopConditionLoop in class Applicator
        Returns:
        true if the condition loop shall exit before the next iteration, false if the loop shall continue (default)
      • allConditionsEnabled

        public boolean allConditionsEnabled()
        Returns whether all matching conditions are enabled.
        Returns:
        true if all conditions are enabled, false else