Class InfixPowerOfOperator
- java.lang.Object
-
- com.ezylang.evalex.operators.AbstractOperator
-
- com.ezylang.evalex.operators.arithmetic.InfixPowerOfOperator
-
- All Implemented Interfaces:
OperatorIfc
@InfixOperator(precedence=40, leftAssociative=false) public class InfixPowerOfOperator extends AbstractOperator
Power of operator, calculates the power of right operand of left operand. The precedence is read from the configuration during parsing.- See Also:
getPrecedence(ExpressionConfiguration)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ezylang.evalex.operators.OperatorIfc
OperatorIfc.OperatorType
-
-
Field Summary
-
Fields inherited from interface com.ezylang.evalex.operators.OperatorIfc
OPERATOR_PRECEDENCE_ADDITIVE, OPERATOR_PRECEDENCE_AND, OPERATOR_PRECEDENCE_COMPARISON, OPERATOR_PRECEDENCE_EQUALITY, OPERATOR_PRECEDENCE_MULTIPLICATIVE, OPERATOR_PRECEDENCE_OR, OPERATOR_PRECEDENCE_POWER, OPERATOR_PRECEDENCE_POWER_HIGHER, OPERATOR_PRECEDENCE_UNARY
-
-
Constructor Summary
Constructors Constructor Description InfixPowerOfOperator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EvaluationValueevaluate(Expression expression, Token operatorToken, EvaluationValue... operands)Performs the operator logic and returns an evaluation result.intgetPrecedence(ExpressionConfiguration configuration)Called during parsing, can be implemented to return a customized precedence.-
Methods inherited from class com.ezylang.evalex.operators.AbstractOperator
isInfix, isLeftAssociative, isOperandLazy, isPostfix, isPrefix
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ezylang.evalex.operators.OperatorIfc
getPrecedence
-
-
-
-
Method Detail
-
evaluate
public EvaluationValue evaluate(Expression expression, Token operatorToken, EvaluationValue... operands) throws EvaluationException
Description copied from interface:OperatorIfcPerforms the operator logic and returns an evaluation result.- Parameters:
expression- The expression, where this function is executed. Can be used to access the expression configuration.operatorToken- The operator token from the parsed expression.operands- The operands, one for prefix and postfix operators, two for infix operators.- Returns:
- The evaluation result in form of a
EvaluationValue. - Throws:
EvaluationException- In case there were problems during evaluation.
-
getPrecedence
public int getPrecedence(ExpressionConfiguration configuration)
Description copied from interface:OperatorIfcCalled during parsing, can be implemented to return a customized precedence.- Specified by:
getPrecedencein interfaceOperatorIfc- Overrides:
getPrecedencein classAbstractOperator- Parameters:
configuration- The expression configuration.- Returns:
- The default precedence from the operator annotation, or a customized value.
-
-