java.lang.Object
studio.magemonkey.codex.util.eval.javaluator.Operator

public class Operator extends Object
Author:
Jean-Marc Astesana
See Also:
  • Constructor Details

    • Operator

      public Operator(String symbol, int operandCount, Operator.Associativity associativity, int precedence)
      Constructor.
      Parameters:
      symbol - The operator name (Currently, the name's length must be one character).
      operandCount - The number of operands of the operator (must be 1 or 2).
      associativity - true if operator is left associative
      precedence - The precedence of the operator.
      The precedence is the priority of the operator. An operator with an higher precedence will be executed before an operator with a lower precedence. Example : In "1+3*4" * has a higher precedence than +, so the expression is interpreted as 1+(3*4).
      Throws:
      IllegalArgumentException - if operandCount if not 1 or 2 or if associativity is none
      NullPointerException - if symbol or associativity are null
  • Method Details