Enum Class JavaOperatorType
- All Implemented Interfaces:
Serializable
,Comparable<JavaOperatorType>
,Constable
Java operator types. Operator types are used to build
Java operators
.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionArithmetic additionBinary andSpecial cast type reserved for integer-to-FP and FP-to-integer conversion operations during an IR conversion pass.Cast to primitiveCast to primitiveCast to primitiveCast to primitiveCast to primitiveCast to primitiveCast to primitiveGeneric cast-to-object operatorCast to primitiveSimilar to ADD (+), but for stringsconditional expression operator: p ? a: bArithmetic divisionLogical equalityLogical greater-than-or-equalLogical greater-thanType checkLogical less-than-or-equalLogical andLogical pseudo-identity operator (generally, does not generate output); the opposite of LOG_NOTLogical notLogical orLogical less-thanArithmetic multiplicationLogical non-equalityArithmetic negationBinary notBinary orArithmetic remainderShift-left (binary shift)Signed shift-right (a.k.a.Arithmetic subtractionUnsigned shift-right (binary shift)Binary xor -
Method Summary
Modifier and TypeMethodDescriptionProvide associativity (left, right) information about the operation type.Retrieve the mirror operator, if any.int
Provide precedence information about the operation type.Retrieve the reverse operator, if any.boolean
isAnyOf
(JavaOperatorType... operatorTypes) boolean
boolean
isBinary()
boolean
isCast()
boolean
boolean
boolean
isUnary()
final JavaOperatorType
mirror()
Same asgetMirror()
.final JavaOperatorType
reverse()
Same asgetReverse()
.static JavaOperatorType
Returns the enum constant of this class with the specified name.static JavaOperatorType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD
Arithmetic addition -
SUB
Arithmetic subtraction -
MUL
Arithmetic multiplication -
DIV
Arithmetic division -
REM
Arithmetic remainder -
AND
Binary and -
OR
Binary or -
XOR
Binary xor -
SHL
Shift-left (binary shift) -
SHR
Signed shift-right (a.k.a. "arithmetic" shift-right: the sign bit is copied over) -
USHR
Unsigned shift-right (binary shift) -
NEG
Arithmetic negation -
NOT
Binary not -
LOG_IDENT
Logical pseudo-identity operator (generally, does not generate output); the opposite of LOG_NOT -
LOG_NOT
Logical not -
LOG_OR
Logical or -
LOG_AND
Logical and -
INSTANCEOF
Type check -
EQ
Logical equality -
NE
Logical non-equality -
LT
Logical less-than -
GE
Logical greater-than-or-equal -
GT
Logical greater-than -
LE
Logical less-than-or-equal -
CAST_TO_BYTE
Cast to primitive -
CAST_TO_CHAR
Cast to primitive -
CAST_TO_SHORT
Cast to primitive -
CAST_TO_INT
Cast to primitive -
CAST_TO_LONG
Cast to primitive -
CAST_TO_FLOAT
Cast to primitive -
CAST_TO_DOUBLE
Cast to primitive -
CAST_TO_BOOLEAN
Cast to primitive -
CAST_TO_OBJECT
Generic cast-to-object operator -
CONCAT
Similar to ADD (+), but for strings -
COND_EXP
conditional expression operator: p ? a: b -
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
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
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 nameNullPointerException
- 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
Provide associativity (left, right) information about the operation type.- Returns:
- the associativity, or null if irrelevant
-
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
Same asgetMirror()
. -
getReverse
Retrieve the reverse operator, if any.== -> != != -> == > -> <= >= -> < < -> >= <= -> > IDENT -> ! ! -> IDENT
- Returns:
- the reverse operator or null
-
reverse
Same asgetReverse()
. -
isAnyOf
-
isUnary
public boolean isUnary() -
isBinary
public boolean isBinary() -
isArithmetic
public boolean isArithmetic() -
isLogical
public boolean isLogical() -
isCast
public boolean isCast() -
isCastToPrimitive
public boolean isCastToPrimitive()
-