Enum UnaryOperator

    • Enum Constant Detail

      • NEG

        public static final UnaryOperator NEG
        Arithmetic negation, -, applied to a single numeric operand.
      • POS

        public static final UnaryOperator POS
        Unary plus, +, which leaves the value alone but still promotes a narrower operand to int.
      • BNOT

        public static final UnaryOperator BNOT
        Bitwise complement, ~, flipping every bit of an integral operand.
      • NOT

        public static final UnaryOperator NOT
        Logical negation, !, applying to a boolean operand.
      • PRE_INC

        public static final UnaryOperator PRE_INC
        Prefix increment, ++x, which yields the already-incremented value.
      • PRE_DEC

        public static final UnaryOperator PRE_DEC
        Prefix decrement, --x, which yields the already-decremented value.
      • POST_INC

        public static final UnaryOperator POST_INC
        Postfix increment, x++, which yields the operand's value from before the increment.
      • POST_DEC

        public static final UnaryOperator POST_DEC
        Postfix decrement, x--, which yields the operand's value from before the decrement.
    • 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​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getSymbol

        public String getSymbol()
        Returns:
        the symbol
      • isPrefix

        public boolean isPrefix()
        Returns:
        true if the symbol is written before its operand
      • isPostfix

        public boolean isPostfix()
        Returns:
        true if the symbol is written after its operand
      • isIncDec

        public boolean isIncDec()
        Returns:
        true for the four increment and decrement operators