Enum Class JavaOperatorType

java.lang.Object
java.lang.Enum<JavaOperatorType>
com.pnfsoftware.jeb.core.units.code.java.JavaOperatorType
All Implemented Interfaces:
Serializable, Comparable<JavaOperatorType>, Constable

@Ser(oldId=65599) public enum JavaOperatorType extends Enum<JavaOperatorType>
Java operator types. Operator types are used to build Java operators.
See Also:
  • Enum Constant Details

    • ADD

      public static final JavaOperatorType ADD
      Arithmetic addition
    • SUB

      public static final JavaOperatorType SUB
      Arithmetic subtraction
    • MUL

      public static final JavaOperatorType MUL
      Arithmetic multiplication
    • DIV

      public static final JavaOperatorType DIV
      Arithmetic division
    • REM

      public static final JavaOperatorType REM
      Arithmetic remainder
    • AND

      public static final JavaOperatorType AND
      Binary and
    • OR

      public static final JavaOperatorType OR
      Binary or
    • XOR

      public static final JavaOperatorType XOR
      Binary xor
    • SHL

      public static final JavaOperatorType SHL
      Shift-left (binary shift)
    • SHR

      public static final JavaOperatorType SHR
      Signed shift-right (a.k.a. "arithmetic" shift-right: the sign bit is copied over)
    • USHR

      public static final JavaOperatorType USHR
      Unsigned shift-right (binary shift)
    • NEG

      public static final JavaOperatorType NEG
      Arithmetic negation
    • NOT

      public static final JavaOperatorType NOT
      Binary not
    • LOG_IDENT

      public static final JavaOperatorType LOG_IDENT
      Logical pseudo-identity operator (generally, does not generate output); the opposite of LOG_NOT
    • LOG_NOT

      public static final JavaOperatorType LOG_NOT
      Logical not
    • LOG_OR

      public static final JavaOperatorType LOG_OR
      Logical or
    • LOG_AND

      public static final JavaOperatorType LOG_AND
      Logical and
    • INSTANCEOF

      public static final JavaOperatorType INSTANCEOF
      Type check
    • EQ

      public static final JavaOperatorType EQ
      Logical equality
    • NE

      public static final JavaOperatorType NE
      Logical non-equality
    • LT

      public static final JavaOperatorType LT
      Logical less-than
    • GE

      public static final JavaOperatorType GE
      Logical greater-than-or-equal
    • GT

      public static final JavaOperatorType GT
      Logical greater-than
    • LE

      public static final JavaOperatorType LE
      Logical less-than-or-equal
    • CAST_TO_BYTE

      public static final JavaOperatorType CAST_TO_BYTE
      Cast to primitive
    • CAST_TO_CHAR

      public static final JavaOperatorType CAST_TO_CHAR
      Cast to primitive
    • CAST_TO_SHORT

      public static final JavaOperatorType CAST_TO_SHORT
      Cast to primitive
    • CAST_TO_INT

      public static final JavaOperatorType CAST_TO_INT
      Cast to primitive
    • CAST_TO_LONG

      public static final JavaOperatorType CAST_TO_LONG
      Cast to primitive
    • CAST_TO_FLOAT

      public static final JavaOperatorType CAST_TO_FLOAT
      Cast to primitive
    • CAST_TO_DOUBLE

      public static final JavaOperatorType CAST_TO_DOUBLE
      Cast to primitive
    • CAST_TO_BOOLEAN

      public static final JavaOperatorType CAST_TO_BOOLEAN
      Cast to primitive
    • CAST_TO_OBJECT

      public static final JavaOperatorType CAST_TO_OBJECT
      Generic cast-to-object operator
    • CONCAT

      public static final JavaOperatorType CONCAT
      Similar to ADD (+), but for strings
    • COND_EXP

      public static final JavaOperatorType COND_EXP
      conditional expression operator: p ? a: b
    • CAST_CONVERSION

      public static final JavaOperatorType CAST_CONVERSION
      Special cast type reserved for integer-to-FP and FP-to-integer conversion operations during an IR conversion pass. Client code should not use this operator.
  • Method Details

    • values

      public static JavaOperatorType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JavaOperatorType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPrecedence

      public int getPrecedence()
      Provide precedence information about the operation type.
      Returns:
      a positive value (lower means "higher precedence"), 0 if unknown
    • getAssociativity

      public JavaOperatorType.Associativity getAssociativity()
      Provide associativity (left, right) information about the operation type.
      Returns:
      the associativity, or null if irrelevant
    • getMirror

      public JavaOperatorType getMirror()
      Retrieve the mirror operator, if any.
       ==   ->  ==
       !=   ->  !=
       >    ->  <
       >=   ->  <=
       <    ->  >
       <=   ->  >=
       
      Careful, do not confuse mirror operators and inverse operators. Example: the mirror of GT is LT; the inverse of GT is LE.
      Returns:
      a mirror operator type, null if N/A
    • mirror

      public final JavaOperatorType mirror()
      Same as getMirror().
    • getReverse

      public JavaOperatorType getReverse()
      Retrieve the reverse operator, if any.
       ==    ->  !=
       !=    ->  ==
       >     ->  <=
       >=    ->  <
       <     ->  >=
       <=    ->  >
       IDENT ->  !
       !     ->  IDENT
       
      Returns:
      the reverse operator or null
    • reverse

      public final JavaOperatorType reverse()
      Same as getReverse().
    • isAnyOf

      public boolean isAnyOf(JavaOperatorType... operatorTypes)
    • isUnary

      public boolean isUnary()
    • isBinary

      public boolean isBinary()
    • isArithmetic

      public boolean isArithmetic()
    • isLogical

      public boolean isLogical()
    • isCast

      public boolean isCast()
    • isCastToPrimitive

      public boolean isCastToPrimitive()