Class ASTEQNode
- java.lang.Object
-
- org.apache.velocity.runtime.parser.node.SimpleNode
-
- org.apache.velocity.runtime.parser.node.ASTBinaryOperator
-
- org.apache.velocity.runtime.parser.node.ASTComparisonNode
-
- org.apache.velocity.runtime.parser.node.ASTEQNode
-
- All Implemented Interfaces:
Cloneable,Node,Renderable
- Direct Known Subclasses:
ASTNENode
public class ASTEQNode extends ASTComparisonNode
Handlesarg1 == arg2This operator requires that the LHS and RHS are both of the same Class, both numbers or both coerce-able to strings.- Author:
- Will Glass-Husain, Peter Romianowski, Nathan Bubna
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancompareNonNumber(Object left, Object right)booleancompareNull(Object left, Object right)Always false by default, != and == subclasses must override this.StringgetLiteralOperator()get the string representing the mathematical operatorbooleannumberTest(int compareResult)performs the actual comparison-
Methods inherited from class org.apache.velocity.runtime.parser.node.ASTComparisonNode
compareNumbers, evaluate, jjtAccept, value
-
Methods inherited from class org.apache.velocity.runtime.parser.node.ASTBinaryOperator
init, literal
-
Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode
childrenAccept, cleanupParserAndTokens, clone, clone, dump, dump, dump, 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 Detail
-
ASTEQNode
public ASTEQNode(int id)
-
ASTEQNode
public ASTEQNode(Parser p, int id)
-
-
Method Detail
-
compareNull
public boolean compareNull(Object left, Object right)
Description copied from class:ASTComparisonNodeAlways false by default, != and == subclasses must override this.- Overrides:
compareNullin classASTComparisonNode- Returns:
- comparison result
-
getLiteralOperator
public String getLiteralOperator()
Description copied from class:ASTComparisonNodeget the string representing the mathematical operator- Specified by:
getLiteralOperatorin classASTComparisonNode- Returns:
- operator string
-
numberTest
public boolean numberTest(int compareResult)
Description copied from class:ASTComparisonNodeperforms the actual comparison- Specified by:
numberTestin classASTComparisonNode- Returns:
- comparison result
-
compareNonNumber
public boolean compareNonNumber(Object left, Object right)
- Overrides:
compareNonNumberin classASTComparisonNode
-
-