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 Object |
handleSpecial(Object left,
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.
|
Object |
init(InternalContextAdapter context,
Object data) |
Object |
jjtAccept(ParserVisitor visitor,
Object data) |
abstract Number |
perform(Number left,
Number right,
InternalContextAdapter context)
Performs the math operation represented by this node.
|
Object |
value(InternalContextAdapter context)
gets the two args and performs the operation on them
|
getLiteralOperator, literalchildrenAccept, 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, toStringpublic ASTMathNode(int id)
public ASTMathNode(Parser p, int id)
public Object init(InternalContextAdapter context, Object data) throws TemplateInitException
init in interface Nodeinit in class ASTBinaryOperatorTemplateInitExceptionNode.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)public Object jjtAccept(ParserVisitor visitor, Object data)
jjtAccept in interface NodejjtAccept in class SimpleNodeNode.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)public Object value(InternalContextAdapter context) throws MethodInvocationException
value in interface Nodevalue in class SimpleNodecontext - MethodInvocationExceptionNode.value(org.apache.velocity.context.InternalContextAdapter)protected Object handleSpecial(Object left, Object right, InternalContextAdapter context)
left - right - context - ASTAddNode.handleSpecial(java.lang.Object, java.lang.Object, org.apache.velocity.context.InternalContextAdapter)public abstract Number perform(Number left, Number right, InternalContextAdapter context)
left - right - context - ASTAddNode.perform(Number, Number, InternalContextAdapter)Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.