Class ASTModNode
java.lang.Object
org.apache.velocity.runtime.parser.node.SimpleNode
org.apache.velocity.runtime.parser.node.ASTBinaryOperator
org.apache.velocity.runtime.parser.node.ASTMathNode
org.apache.velocity.runtime.parser.node.ASTModNode
- All Implemented Interfaces:
Cloneable
,Node
,Renderable
Handles modulus division
Please look at the Parser.jjt file which is what controls the generation of this class.
Please look at the Parser.jjt file which is what controls the generation of this class.
- Version:
- $Id$
- Author:
- Will Glass-Husain, Peter Romianowski, Geir Magnusson Jr.
-
Field Summary
Fields inherited from class org.apache.velocity.runtime.parser.node.ASTMathNode
strictMode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget the string representing the mathematical operatorinit
(InternalContextAdapter context, Object data) perform
(Number left, Number right, InternalContextAdapter context) Performs the math operation represented by this node.Methods inherited from class org.apache.velocity.runtime.parser.node.ASTMathNode
handleSpecial, jjtAccept, value
Methods inherited from class org.apache.velocity.runtime.parser.node.ASTBinaryOperator
literal
Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode
childrenAccept, cleanupParserAndTokens, clone, clone, 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
-
Constructor Details
-
ASTModNode
public ASTModNode(int id) - Parameters:
id
-
-
ASTModNode
- Parameters:
p
-id
-
-
-
Method Details
-
perform
Description copied from class:ASTMathNode
Performs the math operation represented by this node.- Specified by:
perform
in classASTMathNode
- Parameters:
left
-right
-context
-- Returns:
- computed value
- See Also:
-
init
Description copied from class:ASTMathNode
- Specified by:
init
in interfaceNode
- Overrides:
init
in classASTMathNode
- Parameters:
context
-data
-- Returns:
- The init result.
- Throws:
TemplateInitException
- See Also:
-
getLiteralOperator
Description copied from class:ASTBinaryOperator
get the string representing the mathematical operator- Specified by:
getLiteralOperator
in classASTBinaryOperator
- Returns:
- operator string
-