Interface IConstraintEvaluator

  • All Known Implementing Classes:
    EvaluationVisitor, EvalVisitor

    public interface IConstraintEvaluator
    Interface to the constraint evaluator to avoid unnecessary access when passing along an evaluation visitor.
    Author:
    Holger Eichelberger
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean constraintFailed()
      Returns whether the constraint evaluation indicates that the evaluated constraint failed.
      boolean constraintFulfilled()
      Returns whether the constraint evaluation indicates that the evaluated constraint was fulfilled.
      boolean constraintIsAWarning()
      Returns whether the constraint was internally evaluated to false but finally leads to a successful execution and shall lead to a warning to the user.
      boolean constraintUndefined()
      Returns whether the constraint evaluation indicates that (at least one part of) the constraint was undefined.
      EvaluationVisitor.Message getMessage​(int index)
      Returns the specified evaluation message.
      int getMessageCount()
      Returns the number of messages.
      Value getResult()
      Returns the evaluation result.
    • Method Detail

      • constraintFulfilled

        boolean constraintFulfilled()
        Returns whether the constraint evaluation indicates that the evaluated constraint was fulfilled.
        Returns:
        true if the constraint is fulfilled, false else
      • constraintFailed

        boolean constraintFailed()
        Returns whether the constraint evaluation indicates that the evaluated constraint failed. For instance, the following should fail:
        
         a = true;
         b = false;
         
         !a or b
         
        Returns:
        true if the constraint failed, false else
      • constraintUndefined

        boolean constraintUndefined()
        Returns whether the constraint evaluation indicates that (at least one part of) the constraint was undefined.
        Returns:
        true if (at least one part of) the constraint was undefined, false else
      • constraintIsAWarning

        boolean constraintIsAWarning()
        Returns whether the constraint was internally evaluated to false but finally leads to a successful execution and shall lead to a warning to the user.
        Returns:
        true if the constraint shall be issued as a warning, false else.
      • getResult

        Value getResult()
        Returns the evaluation result.
        Returns:
        may be null in case of an expression that cannot be evaluated (shall lead to an exception)
      • getMessageCount

        int getMessageCount()
        Returns the number of messages.
        Returns:
        the number of messages
      • getMessage

        EvaluationVisitor.Message getMessage​(int index)
        Returns the specified evaluation message.
        Parameters:
        index - the message to return
        Returns:
        the specified message
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= getMessageCount()