org.apache.xpath.objects

Class XBoolean

public class XBoolean extends XObject

This class represents an XPath boolean object, and is capable of converting the boolean to other types, such as a string.

UNKNOWN: advanced

Field Summary
static XBooleanS_FALSE
A true boolean object so we don't have to keep creating them.
static XBooleanS_TRUE
A true boolean object so we don't have to keep creating them.
Constructor Summary
XBoolean(boolean b)
Construct a XBoolean object.
XBoolean(Boolean b)
Construct a XBoolean object.
Method Summary
booleanbool()
Cast result object to a boolean.
booleanequals(XObject obj2)
Tell if two objects are functionally equal.
intgetType()
Tell that this is a CLASS_BOOLEAN.
StringgetTypeString()
Given a request type, return the equivalent string.
doublenum()
Cast result object to a number.
Objectobject()
Return a java object that's closest to the representation that should be handed to an extension.
Stringstr()
Cast result object to a string.

Field Detail

S_FALSE

public static final XBoolean S_FALSE
A true boolean object so we don't have to keep creating them.

UNKNOWN: internal

S_TRUE

public static final XBoolean S_TRUE
A true boolean object so we don't have to keep creating them.

UNKNOWN: internal

Constructor Detail

XBoolean

public XBoolean(boolean b)
Construct a XBoolean object.

Parameters: b Value of the boolean object

XBoolean

public XBoolean(Boolean b)
Construct a XBoolean object.

Parameters: b Value of the boolean object

Method Detail

bool

public boolean bool()
Cast result object to a boolean.

Returns: The object value as a boolean

equals

public boolean equals(XObject obj2)
Tell if two objects are functionally equal.

Parameters: obj2 Object to compare to this

Returns: True if the two objects are equal

Throws: javax.xml.transform.TransformerException

getType

public int getType()
Tell that this is a CLASS_BOOLEAN.

Returns: type of CLASS_BOOLEAN

getTypeString

public String getTypeString()
Given a request type, return the equivalent string. For diagnostic purposes.

Returns: type string "#BOOLEAN"

num

public double num()
Cast result object to a number.

Returns: numeric value of the object value

object

public Object object()
Return a java object that's closest to the representation that should be handed to an extension.

Returns: The object's value as a java object

str

public String str()
Cast result object to a string.

Returns: The object's value as a string

Copyright © 2005 Apache XML Project. All Rights Reserved.