com.waveset.expression
Class ExFunction.f_and
java.lang.Object
com.waveset.expression.ExNode
com.waveset.expression.ExFunction.f_and
- All Implemented Interfaces:
- com.sun.idm.debugger.common.Locatable
- Enclosing class:
- ExFunction
- public static class ExFunction.f_and
- extends ExNode
The function node for the <and> expression.
The and expression returns a value that is logically true if
all of the subexpression values are logically true. If any
subexpression value is logically false, the expression
returns the integer 0.
Logical truth is defined by the ExValue.isTrue() method.
Essentially, any string or object value that is non-null or
any integer value that is non-zero, is considered logically true.
The function returns logical truth by returning the value
of the last subexpression. This is mostly for consistency with
the <or> expression, but may be useful on occasion. An and
expression therefore functions like a <block> expression
provided all subexpression values are true.
Method Summary |
protected ExValue |
evalInternal(ExState state)
Doesn't return 1 or 0, it behaves similar to "or" and
returns the value of the last expression if true, or 0 if false. |
java.lang.String |
getFunctionName()
Nodes representing functions must have a name. |
Methods inherited from class com.waveset.expression.ExNode |
addChild, addChildren, addCommonAttributes, beginTrace, clearOwner, endTrace, eval, evalChild, evalChildToObject, evalChildToString, evalToBoolean, evalToInt, evalToObject, evalToString, getBindingCount, getChild, getChildren, getDecoration, getHiddenVariable, getLocation, getOwner, getParent, isLiteral, parseCommonAttributes, parseXml, postProcess, removeChild, resolveFunction, resolveVariable, setBindingCount, setChildren, setDecoration, setEnvironment, setLocation, setOwner, setOwner, setParent, toXml, toXml, toXml, toXmlAttributes, toXmlChildren |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExFunction.f_and
public ExFunction.f_and()
getFunctionName
public java.lang.String getFunctionName()
- Description copied from class:
ExNode
- Nodes representing functions must have a name.
This name is used in the formatting of default trace
messages and the default XML rendering.
If a node doesn't have a name for some reason, or needs
more control over the trace messges and XML, they
must overload beginTrace, endTrace, and toXml below.
- Specified by:
getFunctionName
in class ExNode
evalInternal
protected ExValue evalInternal(ExState state)
throws WavesetException
- Doesn't return 1 or 0, it behaves similar to "or" and
returns the value of the last expression if true, or 0 if false.
This is arguably less useful here, but be consistent with or.
- Specified by:
evalInternal
in class ExNode
- Throws:
WavesetException