Package org.apache.felix.gogo.runtime
Class Expression.Operator
- java.lang.Object
-
- org.apache.felix.gogo.runtime.Expression.Operator
-
- Direct Known Subclasses:
Expression.Assignment
,Expression.Comparator
- Enclosing class:
- Expression
public abstract class Expression.Operator extends java.lang.Object
Abstract definition of a supported operator. An operator is defined by its name (pattern), precedence and if it is left- or right associative.
-
-
Constructor Summary
Constructors Constructor Description Operator(java.lang.String oper, int precedence, boolean leftAssoc)
Creates a new operator.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
eval(java.lang.String v1, java.lang.String v2)
abstract java.math.BigDecimal
eval(java.math.BigDecimal v1, java.math.BigDecimal v2)
Implementation for this operator.java.lang.Object
eval(java.util.Map<java.lang.String,java.lang.Object> variables, java.lang.Object v1, java.lang.Object v2)
java.lang.String
getOper()
int
getPrecedence()
boolean
isLeftAssoc()
java.lang.String
toString()
-
-
-
Method Detail
-
getOper
public java.lang.String getOper()
-
getPrecedence
public int getPrecedence()
-
isLeftAssoc
public boolean isLeftAssoc()
-
eval
public java.lang.Object eval(java.util.Map<java.lang.String,java.lang.Object> variables, java.lang.Object v1, java.lang.Object v2)
-
eval
public java.lang.Object eval(java.lang.String v1, java.lang.String v2)
-
eval
public abstract java.math.BigDecimal eval(java.math.BigDecimal v1, java.math.BigDecimal v2)
Implementation for this operator.- Parameters:
v1
- Operand 1.v2
- Operand 2.- Returns:
- The result of the operation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-