public abstract class ASTMathNode extends ASTBinaryOperator
Modifier and Type | Field and Description |
---|---|
protected boolean |
strictMode |
Constructor and Description |
---|
ASTMathNode(int id) |
ASTMathNode(Parser p,
int id) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
handleSpecial(java.lang.Object left,
java.lang.Object right,
InternalContextAdapter context)
Extension hook to allow special behavior by subclasses
If this method returns a non-null value, that is returned,
rather than the result of the math operation.
|
java.lang.Object |
init(InternalContextAdapter context,
java.lang.Object data) |
java.lang.Object |
jjtAccept(ParserVisitor visitor,
java.lang.Object data) |
abstract java.lang.Number |
perform(java.lang.Number left,
java.lang.Number right,
InternalContextAdapter context)
Performs the math operation represented by this node.
|
java.lang.Object |
value(InternalContextAdapter context)
gets the two args and performs the operation on them
|
getLiteralOperator, literal
childrenAccept, cleanupParserAndTokens, dump, dump, dump, evaluate, execute, getColumn, getFirstToken, getFirstTokenImage, getInfo, getLastToken, getLastTokenImage, getLine, getLocation, getParser, getRuntimeServices, getTemplate, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, render, saveTokenImages, setFirstToken, setInfo, setInvalid, toString, toString
public ASTMathNode(int id)
public ASTMathNode(Parser p, int id)
public java.lang.Object init(InternalContextAdapter context, java.lang.Object data) throws TemplateInitException
init
in interface Node
init
in class ASTBinaryOperator
TemplateInitException
Node.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
public java.lang.Object jjtAccept(ParserVisitor visitor, java.lang.Object data)
jjtAccept
in interface Node
jjtAccept
in class SimpleNode
Node.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)
public java.lang.Object value(InternalContextAdapter context) throws MethodInvocationException
value
in interface Node
value
in class SimpleNode
context
- MethodInvocationException
Node.value(org.apache.velocity.context.InternalContextAdapter)
protected java.lang.Object handleSpecial(java.lang.Object left, java.lang.Object right, InternalContextAdapter context)
left
- right
- context
- ASTAddNode.handleSpecial(java.lang.Object, java.lang.Object, org.apache.velocity.context.InternalContextAdapter)
public abstract java.lang.Number perform(java.lang.Number left, java.lang.Number right, InternalContextAdapter context)
left
- right
- context
- ASTAddNode.perform(Number, Number, InternalContextAdapter)