Class Applicator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object[] rhsValues  
      protected Rule rule  
    • Constructor Summary

      Constructors 
      Constructor Description
      Applicator()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void apply​(java.lang.Object expectedLhsValue, java.lang.Object rhsValue, int index)
      Apply this applicator for one combination which requires building.
      protected void conditionLoopFinished()
      Notifies when the condition loop terminated.
      int getElementCount()
      Returns the value of the elements handles by this applicator, i.e., the maximum index + 1.
      protected void initialize​(Rule rule, java.lang.Object[] rhsValues)
      Initializes the applicator for the underlying loop.
      protected void matchLoopFinished()
      Notifies when the match loop terminated.
      protected boolean stopConditionLoop()
      Enables a pre-exit of the condition loop.
      protected boolean stopMatchLoop()
      Enables a pre-exit of the match loop.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • rule

        protected Rule rule
      • rhsValues

        protected java.lang.Object[] rhsValues
    • Constructor Detail

      • Applicator

        public Applicator()
    • Method Detail

      • initialize

        protected void initialize​(Rule rule,
                                  java.lang.Object[] rhsValues)
        Initializes the applicator for the underlying loop. This method has been defined here in order to ensure consistency between applicator and underlying loop.
        Parameters:
        rule - the rule to work on
        rhsValues - the RHS value
      • apply

        public abstract void apply​(java.lang.Object expectedLhsValue,
                                   java.lang.Object rhsValue,
                                   int index)
                            throws VilException
        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)
        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 (getElementCount()
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid
        VilException - in case that executing parts of a rule or setting variable values fails
      • getElementCount

        public int getElementCount()
        Returns the value of the elements handles by this applicator, i.e., the maximum index + 1.
        Returns:
        the element count
      • stopMatchLoop

        protected boolean stopMatchLoop()
        Enables a pre-exit of the match loop.
        Returns:
        true if the match loop shall exit before the next iteration, false if the loop shall continue (default)
      • stopConditionLoop

        protected boolean stopConditionLoop()
        Enables a pre-exit of the condition loop.
        Returns:
        true if the condition loop shall exit before the next iteration, false if the loop shall continue (default)
      • matchLoopFinished

        protected void matchLoopFinished()
                                  throws VilException
        Notifies when the match loop terminated.
        Throws:
        VilException - in case that executing parts of a rule fails
      • conditionLoopFinished

        protected void conditionLoopFinished()
                                      throws VilException
        Notifies when the condition loop terminated.
        Throws:
        VilException - in case that executing parts of a rule fails