public class NullWrappedLazyLogical extends PostfixMathCommand implements CallbackEvaluationI, NullWrappedFunctionI
A OR B | True | False | null |
---|---|---|---|
True | True | True | True |
False | True | False | null |
null | True | null | null |
A AND B | True | False | null |
---|---|---|---|
True | True | False | null |
False | False | False | False |
null | null | False | null |
A | NOT A |
---|---|
True | False |
False | True |
null | null |
LazyLogical
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected boolean |
allowNumbers |
static int |
AND |
protected int |
id
Represents which logical operator this is.
|
static int |
OR |
curNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
NullWrappedLazyLogical(int id_in)
Standard constructor, non zero Numbers will be treated as true and zero Numbers as false.
|
NullWrappedLazyLogical(int id_in,
boolean disallowNumbers)
Constructor which restricts type of arguments.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(Node node,
Evaluator pv)
Performs some special evaluation on the node.
|
PostfixMathCommandI |
getRoot()
Get to function which this function wraps.
|
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, run, setCurNumberOfParameters, setName, toString, toString
public static final int AND
public static final int OR
protected int id
protected boolean allowNumbers
public NullWrappedLazyLogical(int id_in)
id_in
- either of the constants AND or ORpublic NullWrappedLazyLogical(int id_in, boolean disallowNumbers)
id_in
- disallowNumbers
- if true Number arguments will raise exceptions,
otherwise as the Standard constructor.public PostfixMathCommandI getRoot()
NullWrappedFunctionI
getRoot
in interface NullWrappedFunctionI
public java.lang.Object evaluate(Node node, Evaluator pv) throws EvaluationException
CallbackEvaluationI
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.
evaluate
in interface CallbackEvaluationI
node
- The current nodepv
- The visitor, can be used evaluate the childrenEvaluationException
- if the calculation cannot be performedEvaluator
Copyright © 2018 Singular Systems http://www.singularsys.com/jep