com.icl.saxon.expr

Class BooleanValue

public final class BooleanValue extends Value

A boolean XPath value
Constructor Summary
BooleanValue(boolean value)
Constructor: create a boolean value
Method Summary
booleanasBoolean()
Convert to boolean (null operation)
doubleasNumber()
Convert to number
StringasString()
Convert to string
intconversionPreference(Class required)
Get conversion preference for this value to a Java class.
ObjectconvertToJava(Class target)
Convert to Java object (for passing to external functions)
voiddisplay(int level)
Diagnostic print of expression structure
intgetDataType()
Determine the data type of the exprssion

Constructor Detail

BooleanValue

public BooleanValue(boolean value)
Constructor: create a boolean value

Parameters: value the initial value, true or false

Method Detail

asBoolean

public boolean asBoolean()
Convert to boolean (null operation)

Returns: the value

asNumber

public double asNumber()
Convert to number

Returns: 1 for true, 0 for false

asString

public String asString()
Convert to string

Returns: "true" or "false"

conversionPreference

public int conversionPreference(Class required)
Get conversion preference for this value to a Java class. A low result indicates higher preference.

convertToJava

public Object convertToJava(Class target)
Convert to Java object (for passing to external functions)

display

public void display(int level)
Diagnostic print of expression structure

getDataType

public int getDataType()
Determine the data type of the exprssion

Returns: Value.BOOLEAN,