public class BooleanFunction extends Object implements Function
4.3 boolean boolean(object)
The boolean function converts its argument to a boolean as follows:
a number is true if and only if it is neither positive or negative zero nor NaN
a node-set is true if and only if it is non-empty
a string is true if and only if its length is non-zero
an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
| Constructor and Description |
|---|
BooleanFunction()
Create a new
BooleanFunction object. |
public Object call(Context context, List args) throws FunctionCallException
Booleancall in interface Functioncontext - the context at the point in the
expression when the function is calledargs - a list with exactly one item which will be converted to a
BooleanBoolean.TRUE or Boolean.FALSEFunctionCallException - if args has more or less than one itempublic static Boolean evaluate(Object obj, Navigator nav)
Convert the argument obj to a Boolean
according to the following rules:
obj - the object to convert to a booleannav - ignoredBoolean.TRUE or Boolean.FALSECopyright © 2001-2012 Codehaus. All Rights Reserved.