com.singularsys.jep.misc.nullwrapper.functions
Class NullLazyLogical
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.misc.nullwrapper.functions.NullLazyLogical
- All Implemented Interfaces:
- CallbackEvaluationI, PostfixMathCommandI, java.io.Serializable
public class NullLazyLogical
- extends PostfixMathCommand
- implements CallbackEvaluationI
Null wrapped versions of the LazyLogical functions.
- Since:
- 3.4
- Author:
- Richard Morris
- See Also:
LazyLogical
,
Serialized Form
Field Summary |
static int |
AND
|
static int |
OR
|
Constructor Summary |
NullLazyLogical(int id_in)
Standard constructor, non zero Numbers will be treated as true and zero Numbers as false. |
NullLazyLogical(int id_in,
boolean disallowNumbers)
Constructor which restricts type of arguments. |
Method Summary |
java.lang.Object |
evaluate(Node node,
Evaluator pv)
Performs some special evaluation on the node. |
void |
run(java.util.Stack<java.lang.Object> inStack)
Run the function on the stack. |
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand |
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, checkStack, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AND
public static final int AND
- See Also:
- Constant Field Values
OR
public static final int OR
- See Also:
- Constant Field Values
NullLazyLogical
public NullLazyLogical(int id_in)
- Standard constructor, non zero Numbers will be treated as true and zero Numbers as false.
- Parameters:
id_in
- either of the constants AND or OR
NullLazyLogical
public NullLazyLogical(int id_in,
boolean disallowNumbers)
- Constructor which restricts type of arguments.
- Parameters:
id_in
- disallowNumbers
- if true Number arguments will raise exceptions,
otherwise as the Standard constructor.
run
public void run(java.util.Stack<java.lang.Object> inStack)
throws EvaluationException
- Description copied from interface:
PostfixMathCommandI
- Run the function on the stack. Pops the arguments from the stack, and
pushes the result on the top of the stack.
- Specified by:
run
in interface PostfixMathCommandI
- Throws:
EvaluationException
evaluate
public java.lang.Object evaluate(Node node,
Evaluator pv)
throws EvaluationException
- Description copied from interface:
CallbackEvaluationI
- Performs some special evaluation on the node.
This method has the responsibility for evaluating the children of the node
and it should generally call
pv.eval(node.jjtGetChild(i))
for each child.
The SymbolTable is not passed as an argument. This is because
it is better practice to get and set variable values by using
node.getVar().setValue() rather that through the SymbolTable with
requires a hashtable lookup.
- Specified by:
evaluate
in interface CallbackEvaluationI
- Parameters:
node
- The current nodepv
- The visitor, can be used evaluate the children
- Returns:
- the value after evaluation. This value will be passed to other
functions higher up the node tree. The value can be any type including Double or Vector<Object>
- Throws:
EvaluationException
- See Also:
Evaluator
Copyright © 2010 Singular Systems http://www.singularsys.com/jep