Package io.atlasmap.expression.internal
Class ArithmeticExpression
- java.lang.Object
-
- io.atlasmap.expression.internal.BinaryExpression
-
- io.atlasmap.expression.internal.ArithmeticExpression
-
- All Implemented Interfaces:
Expression
public abstract class ArithmeticExpression extends BinaryExpression
An expression which performs an operation on two expression values.- Version:
- $Revision: 1.2 $
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDOUBLEprotected static intINTEGERprotected static intLONG-
Fields inherited from class io.atlasmap.expression.internal.BinaryExpression
left, right
-
Fields inherited from interface io.atlasmap.expression.Expression
CACHE
-
-
Constructor Summary
Constructors Constructor Description ArithmeticExpression(Expression left, Expression right)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected NumberasNumber(Object value)static ExpressioncreateDivide(Expression left, Expression right)static ExpressioncreateMinus(Expression left, Expression right)static ExpressioncreateMod(Expression left, Expression right)static ExpressioncreateMultiply(Expression left, Expression right)static ExpressioncreatePlus(Expression left, Expression right)protected Numberdivide(Number left, Number right)io.atlasmap.v2.Fieldevaluate(ExpressionContext message)Execute the expression against the given context.protected abstract io.atlasmap.v2.Fieldevaluate(io.atlasmap.v2.Field lvalue, io.atlasmap.v2.Field rvalue)Evaluate expression.protected Numberminus(Number left, Number right)protected Numbermod(Number left, Number right)protected Numbermultiply(Number left, Number right)protected Numberplus(Number left, Number right)-
Methods inherited from class io.atlasmap.expression.internal.BinaryExpression
equals, getExpressionSymbol, getLeft, getRight, hashCode, setLeft, setRight, toString
-
-
-
-
Field Detail
-
INTEGER
protected static final int INTEGER
- See Also:
- Constant Field Values
-
LONG
protected static final int LONG
- See Also:
- Constant Field Values
-
DOUBLE
protected static final int DOUBLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArithmeticExpression
public ArithmeticExpression(Expression left, Expression right)
Constructor.- Parameters:
left- The leftExpressionright- The rightExpression
-
-
Method Detail
-
createPlus
public static Expression createPlus(Expression left, Expression right)
-
createMinus
public static Expression createMinus(Expression left, Expression right)
-
createMultiply
public static Expression createMultiply(Expression left, Expression right)
-
createDivide
public static Expression createDivide(Expression left, Expression right)
-
createMod
public static Expression createMod(Expression left, Expression right)
-
evaluate
public io.atlasmap.v2.Field evaluate(ExpressionContext message) throws ExpressionException
Description copied from interface:ExpressionExecute the expression against the given context.- Parameters:
message-ExpressionContext- Returns:
Fieldrepresents a result- Throws:
ExpressionException- If evaluation fails
-
evaluate
protected abstract io.atlasmap.v2.Field evaluate(io.atlasmap.v2.Field lvalue, io.atlasmap.v2.Field rvalue)Evaluate expression.- Parameters:
lvalue-Fieldrepresents left valuervalue-Fieldrepresents right value- Returns:
Fieldreporesents a result
-
-