Enum UnaryOperator

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      LOGICAL_NOT
      Given a Boolean value of type BooleanType, this operator returns the logical negation of the value: if the Boolean value represents true, it returns false, and vice versa.
      NUMERIC_NEG
      Given a numeric value of type NumericType, this operator returns the negation of the numerical value.
      STRING_LENGTH
      Given a string of type StringType returns the length of that string.
      TYPEOF
      Yields the Type of an expression.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getStringRepresentation()
      Yields the string representation of the operator.
      java.lang.String toString()  
      static UnaryOperator valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UnaryOperator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LOGICAL_NOT

        public static final UnaryOperator LOGICAL_NOT
        Given a Boolean value of type BooleanType, this operator returns the logical negation of the value: if the Boolean value represents true, it returns false, and vice versa. The return type of this operation is BooleanType.
      • NUMERIC_NEG

        public static final UnaryOperator NUMERIC_NEG
        Given a numeric value of type NumericType, this operator returns the negation of the numerical value. The return type of this operator is a signed NumericType.
      • STRING_LENGTH

        public static final UnaryOperator STRING_LENGTH
        Given a string of type StringType returns the length of that string. If the value represents the empty string, it returns 0. The return type of this operator is a 32 bit unsigned NumericType.
    • Method Detail

      • values

        public static UnaryOperator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UnaryOperator c : UnaryOperator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UnaryOperator valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getStringRepresentation

        public java.lang.String getStringRepresentation()
        Description copied from interface: Operator
        Yields the string representation of the operator.
        Specified by:
        getStringRepresentation in interface Operator
        Returns:
        the string representation
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<UnaryOperator>