public abstract class ASTComparisonNode extends ASTBinaryOperator
Constructor and Description |
---|
ASTComparisonNode(int id) |
ASTComparisonNode(Parser p,
int id) |
Modifier and Type | Method and Description |
---|---|
boolean |
compareNonNumber(Object left,
Object right) |
boolean |
compareNull(Object left,
Object right)
Always false by default, != and == subclasses must override this.
|
Boolean |
compareNumbers(Object left,
Object right)
compare numbers
|
boolean |
evaluate(InternalContextAdapter context) |
abstract String |
getLiteralOperator()
get the string representing the mathematical operator
|
Object |
jjtAccept(ParserVisitor visitor,
Object data) |
abstract boolean |
numberTest(int compareResult)
performs the actual comparison
|
Object |
value(InternalContextAdapter context) |
init, literal
childrenAccept, cleanupParserAndTokens, dump, dump, dump, execute, getColumn, getFirstToken, getFirstTokenImage, getInfo, getLastToken, getLastTokenImage, getLine, getLocation, getRuntimeServices, getTemplate, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, render, saveTokenImages, setFirstToken, setInfo, setInvalid, toString, toString
public ASTComparisonNode(int id)
id
- public ASTComparisonNode(Parser p, int id)
p
- id
- public Object jjtAccept(ParserVisitor visitor, Object data)
jjtAccept
in interface Node
jjtAccept
in class SimpleNode
SimpleNode.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)
public boolean evaluate(InternalContextAdapter context) throws MethodInvocationException
evaluate
in interface Node
evaluate
in class SimpleNode
MethodInvocationException
SimpleNode.evaluate(org.apache.velocity.context.InternalContextAdapter)
public boolean compareNull(Object left, Object right)
left
- right
- public Boolean compareNumbers(Object left, Object right)
left
- right
- public abstract String getLiteralOperator()
getLiteralOperator
in class ASTBinaryOperator
public abstract boolean numberTest(int compareResult)
compareResult
- public Object value(InternalContextAdapter context) throws MethodInvocationException
value
in interface Node
value
in class SimpleNode
MethodInvocationException
SimpleNode.value(org.apache.velocity.context.InternalContextAdapter)
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.