public abstract class ASTMathNode extends SimpleNode
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
|
childrenAccept, dump, evaluate, execute, getColumn, getFirstToken, getInfo, getLastToken, getLine, getLocation, getRuntimeServices, getTemplate, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, render, setFirstToken, setInfo, setInvalid, toString, toString
public ASTMathNode(int id)
public ASTMathNode(Parser p, int id)
public Object init(InternalContextAdapter context, Object data) throws TemplateInitException
init
in interface Node
init
in class SimpleNode
TemplateInitException
Node.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
public Object jjtAccept(ParserVisitor visitor, Object data)
jjtAccept
in interface Node
jjtAccept
in class SimpleNode
Node.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)
public Object value(InternalContextAdapter context) throws MethodInvocationException
value
in interface Node
value
in class SimpleNode
context
- MethodInvocationException
Node.value(org.apache.velocity.context.InternalContextAdapter)
protected Object handleSpecial(Object left, Object right, InternalContextAdapter context)
public abstract Number perform(Number left, Number right, InternalContextAdapter context)
Copyright © 2000–2016 The Apache Software Foundation. All rights reserved.