org.apache.xpath.objects

Class XNull

public class XNull extends XNodeSet

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

UNKNOWN: general

Constructor Summary
XNull()
Create an XObject.
Method Summary
booleanbool()
Cast result object to a boolean.
booleanequals(XObject obj2)
Tell if two objects are functionally equal.
intgetType()
Tell what kind of class this is.
StringgetTypeString()
Given a request type, return the equivalent string.
doublenum()
Cast result object to a number.
intrtf(XPathContext support)
Cast result object to a result tree fragment.
Stringstr()
Cast result object to a string.

Constructor Detail

XNull

public XNull()
Create an XObject.

Method Detail

bool

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

Returns: false

equals

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

Parameters: obj2 Object to compare this to

Returns: True if the given object is of type CLASS_NULL

getType

public int getType()
Tell what kind of class this is.

Returns: type CLASS_NULL

getTypeString

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

Returns: type string "#CLASS_NULL"

num

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

Returns: 0.0

rtf

public int rtf(XPathContext support)
Cast result object to a result tree fragment.

Parameters: support XPath context to use for the conversion

Returns: The object as a result tree fragment.

str

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

Returns: empty string ""

Copyright © 2005 Apache XML Project. All Rights Reserved.