Package org.mvel2.ast
Class BinaryOperation
- java.lang.Object
-
- org.mvel2.ast.ASTNode
-
- org.mvel2.ast.BooleanNode
-
- org.mvel2.ast.BinaryOperation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class BinaryOperation extends BooleanNode
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
lType
private int
operation
private int
rType
-
Fields inherited from class org.mvel2.ast.BooleanNode
left, right
-
Fields inherited from class org.mvel2.ast.ASTNode
accessor, ARRAY_TYPE_LITERAL, ASSIGN, BLOCK_DO, BLOCK_DO_UNTIL, BLOCK_FOR, BLOCK_FOREACH, BLOCK_IF, BLOCK_UNTIL, BLOCK_WHILE, BLOCK_WITH, COLLECTION, COMPILE_IMMEDIATE, cursorPosition, DEEP_PROPERTY, DEFERRED_TYPE_RES, DEOP, DISCARD, egressType, endOfName, expr, fields, firstUnion, FQCN, IDENTIFIER, INLINE_COLLECTION, INVERT, literal, LITERAL, nameCache, nextASTNode, NOJIT, NUMERIC, offset, OPERATOR, OPT_SUBTR, pCtx, PCTX_STORED, safeAccessor, STACKLANG, start, STRONG_TYPING, THISREF
-
-
Constructor Summary
Constructors Constructor Description BinaryOperation(int operation, ASTNode left, ASTNode right, ParserContext ctx)
BinaryOperation(int operation, ParserContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
areCompatible(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
private boolean
doesRequireConversion(java.lang.Class leftType, java.lang.Class rightType, int op)
private int
getOperandType(ASTNode node)
int
getOperation()
java.lang.Object
getReducedValue(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
java.lang.Object
getReducedValueAccelerated(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
ASTNode
getRightMost()
private boolean
isAritmeticOperation(int operation)
boolean
isLiteral()
void
setRightMost(ASTNode right)
java.lang.String
toString()
-
Methods inherited from class org.mvel2.ast.BooleanNode
getLeft, getRight, setLeft, setRight
-
Methods inherited from class org.mvel2.ast.ASTNode
canSerializeAccessor, discard, getAbsoluteName, getAbsoluteRootElement, getAccessor, getClassLoader, getCursorPosition, getEgressType, getExpr, getFields, getLiteralValue, getName, getNameAsArray, getOffset, getOperator, getStart, isAssignment, isCollection, isDebuggingSymbol, isDeepProperty, isDiscard, isFQCN, isIdentifier, isOperator, isOperator, isThisVal, setAccessor, setAsFQCNReference, setAsLiteral, setCursorPosition, setEgressType, setLiteralValue, setName, storeInLiteralRegister, storePctx, strongTyping
-
-
-
-
Constructor Detail
-
BinaryOperation
public BinaryOperation(int operation, ParserContext ctx)
-
BinaryOperation
public BinaryOperation(int operation, ASTNode left, ASTNode right, ParserContext ctx)
-
-
Method Detail
-
getOperandType
private int getOperandType(ASTNode node)
-
doesRequireConversion
private boolean doesRequireConversion(java.lang.Class leftType, java.lang.Class rightType, int op)
-
isAritmeticOperation
private boolean isAritmeticOperation(int operation)
-
areCompatible
private boolean areCompatible(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
getReducedValueAccelerated
public java.lang.Object getReducedValueAccelerated(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
- Overrides:
getReducedValueAccelerated
in classASTNode
-
getReducedValue
public java.lang.Object getReducedValue(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
- Overrides:
getReducedValue
in classASTNode
-
getOperation
public int getOperation()
-
setRightMost
public void setRightMost(ASTNode right)
- Specified by:
setRightMost
in classBooleanNode
-
getRightMost
public ASTNode getRightMost()
- Specified by:
getRightMost
in classBooleanNode
-
-