Class AbstractExpression

    • Constructor Detail

      • AbstractExpression

        public AbstractExpression()
    • Method Detail

      • getGrammar

        public String getGrammar()
        Returns a string representation of the grammar.
        Specified by:
        getGrammar in interface GrammarSupplier
        Returns:
        the grammar, null if not available
      • getDefaultExpression

        protected abstract BooleanExpressionText getDefaultExpression()
        Returns the default expression to use.
        Returns:
        the default
      • setExpression

        public void setExpression​(String value)
        Sets the expression to evaluate. Automatically wraps expressions in parentheses that consists only of a variable. Otherwise, the expresssion would get interpreted as attached variable for the expression option.
        Parameters:
        value - the expression
      • setExpression

        public void setExpression​(BooleanExpressionText value)
        Sets the expression to evaluate. Automatically wraps expressions in parentheses that consists only of a variable. Otherwise, the expresssion would get interpreted as attached variable for the expression option.
        Parameters:
        value - the expression
      • getExpression

        public BooleanExpressionText getExpression()
        Returns the expression to evaluate.
        Returns:
        the expression
      • expressionTipText

        public abstract String expressionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doEvaluate

        protected boolean doEvaluate​(String exp,
                                     HashMap symbols)
        Evaluates the condition.
        Parameters:
        exp - the expression to evaluate
        symbols - the symbols to use in the evaluation
        Returns:
        the result of the boolean condition