Class Expression.MonadicOperator

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    Expression

    public static class Expression.MonadicOperator
    extends Expression.Operator
    "Monadic" operator performs a function on one operand. It can be in either postfix or prefix notation.
    • Prefix notation meaning the operator appears before its operand. operator operand
    • Postfix notation meaning the operator appears after its operand. operand operator
    See Also:
    Serialized Form
    • Constructor Detail

      • MonadicOperator

        public MonadicOperator​(String symbol,
                               int precedence)
        Monodiac operator
        Parameters:
        symbol - the source text or symbol of an operator. e.g =, ==, +, /, >, <, etc
        precedence - the order of precedence where the expression is compiled
    • Method Detail

      • isHigherThan

        public boolean isHigherThan​(Expression.Operator op)
        Check if this operator has higher precedence than op
        Parameters:
        op - the operator
        Returns:
        true if this operation is higher