org.exolab.adaptx.xpath

Class StringResult

public final class StringResult extends XPathResult

Represents a string result. This is an immutable object.

Version: $Revision: 3633 $ $Date: 2003-03-01 02:38:44 -0500 (Sat, 01 Mar 2003) $

Author: Keith Visco

Field Summary
static StringResultEMPTY
String result representing an empty string.
Constructor Summary
StringResult()
Creates a new string result with an empty string as it's value.
StringResult(String value)
Creates a new string result with the given value.
Method Summary
booleanbooleanValue()
Returns the result as a boolean value.
booleanequals(XPathResult result)
Returns true if the given result is a string result and has the same string value.
intgetResultType()
Returns the type of this result.
ObjectjavaObject()
Returns the result as a Java object.
doublenumberValue()
Returns the result as a number value.
StringstringValue()
Returns the result as a string value.
StringtoString()
Returns the String representation of this XPathResult

Field Detail

EMPTY

public static final StringResult EMPTY
String result representing an empty string.

Constructor Detail

StringResult

public StringResult()
Creates a new string result with an empty string as it's value.

StringResult

public StringResult(String value)
Creates a new string result with the given value.

Parameters: value The string value (not null)

Method Detail

booleanValue

public boolean booleanValue()
Returns the result as a boolean value. Returns true if not an empty string.

Returns: The result as a boolean value

equals

public boolean equals(XPathResult result)
Returns true if the given result is a string result and has the same string value.

Parameters: result An XPath result

Returns: True if a string result and has same value

getResultType

public int getResultType()
Returns the type of this result.

Returns: STRING

javaObject

public Object javaObject()
Returns the result as a Java object. Returns an object of type String with the same string value.

Returns: The result as a Java object

numberValue

public double numberValue()
Returns the result as a number value. Returns java.lang.Double#NaN if the value is not a valid number.

Returns: The result as a number value

stringValue

public String stringValue()
Returns the result as a string value.

Returns: The result as a string value

toString

public String toString()
Returns the String representation of this XPathResult

Returns: the String representation of this XPathResult