org.apache.xpath.objects

Class XBoolean

Implemented Interfaces:
Cloneable, Serializable, ExpressionNode, SourceLocator, XPathVisitable
Known Direct Subclasses:
XBooleanStatic

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.

See Also:
Serialized Form

Field Summary

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

Fields inherited from class org.apache.xpath.objects.XObject

CLASS_BOOLEAN, CLASS_NODESET, CLASS_NULL, CLASS_NUMBER, CLASS_RTREEFRAG, CLASS_STRING, CLASS_UNKNOWN, CLASS_UNRESOLVEDVARIABLE

Constructor Summary

XBoolean(Boolean b)
Construct a XBoolean object.
XBoolean(boolean b)
Construct a XBoolean object.

Method Summary

boolean
bool()
Cast result object to a boolean.
boolean
equals(XObject obj2)
Tell if two objects are functionally equal.
int
getType()
Tell that this is a CLASS_BOOLEAN.
String
getTypeString()
Given a request type, return the equivalent string.
double
num()
Cast result object to a number.
Object
object()
Return a java object that's closest to the representation that should be handed to an extension.
String
str()
Cast result object to a string.

Methods inherited from class org.apache.xpath.objects.XObject

allowDetachToRelease, appendToFsb, bool, boolWithSideEffects, callVisitors, castToType, create, create, deepEquals, destruct, detach, dispatchCharactersEvents, equals, execute, fixupVariables, getFresh, getType, getTypeString, greaterThan, greaterThanOrEqual, iter, lessThan, lessThanOrEqual, mutableNodeset, nodelist, nodeset, notEquals, num, numWithSideEffects, object, reset, rtf, rtf, rtree, rtree, str, toString, xstr

Methods inherited from class org.apache.xpath.Expression

asIterator, asIteratorRaw, asNode, assertion, bool, canTraverseOutsideSubtree, deepEquals, error, execute, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, fixupVariables, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isStableNumber, num, warn, xstr

Field Details

S_FALSE

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


S_TRUE

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

Constructor Details

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 Details

bool

public boolean bool()
Cast result object to a boolean.
Overrides:
bool in interface XObject

Returns:
The object value as a boolean


equals

public boolean equals(XObject obj2)
Tell if two objects are functionally equal.
Overrides:
equals in interface XObject

Parameters:
obj2 - Object to compare to this

Returns:
True if the two objects are equal


getType

public int getType()
Tell that this is a CLASS_BOOLEAN.
Overrides:
getType in interface XObject

Returns:
type of CLASS_BOOLEAN


getTypeString

public String getTypeString()
Given a request type, return the equivalent string. For diagnostic purposes.
Overrides:
getTypeString in interface XObject

Returns:
type string "#BOOLEAN"


num

public double num()
Cast result object to a number.
Overrides:
num in interface XObject

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.
Overrides:
object in interface XObject

Returns:
The object's value as a java object


str

public String str()
Cast result object to a string.
Overrides:
str in interface XObject

Returns:
The object's value as a string


Copyright B) 2004 Apache XML Project. All Rights Reserved.