Class PrefixExpression.Operator

  • Enclosing class:
    PrefixExpression

    public static class PrefixExpression.Operator
    extends Object
    Prefix operators (typesafe enumeration).
     PrefixOperator:
        ++  INCREMENT
        --  DECREMENT
        +  PLUS
        -  MINUS
        ~  COMPLEMENT
        !  NOT
     
    • Method Detail

      • toString

        public String toString()
        Returns the character sequence for the operator.
        Overrides:
        toString in class Object
        Returns:
        the character sequence for the operator
      • toOperator

        public static PrefixExpression.Operator toOperator​(String token)
        Returns the prefix operator corresponding to the given string, or null if none.

        toOperator is the converse of toString: that is, Operator.toOperator(op.toString()) == op for all operators op.

        Parameters:
        token - the character sequence for the operator
        Returns:
        the prefix operator, or null if none