org.exolab.adaptx.xpath

Class NumberResult

public final class NumberResult extends XPathResult

Represents a number 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 NumberResultNaN
Number result representing java.lang.Double#NaN (not a number).
Constructor Summary
NumberResult(double value)
Creates a new number 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 number result and has the same number 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()

Field Detail

NaN

public static final NumberResult NaN
Number result representing java.lang.Double#NaN (not a number).

Constructor Detail

NumberResult

public NumberResult(double value)
Creates a new number result with the given value.

Parameters: value The number value

Method Detail

booleanValue

public boolean booleanValue()
Returns the result as a boolean value. Returns true if the number value is not zero.

Returns: The result as a boolean value

equals

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

Parameters: result An XPath result

Returns: True if a number result and has same value

getResultType

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

Returns: NUMBER

javaObject

public Object javaObject()
Returns the result as a Java object. Returns an object of type java.lang.Double with the same number value.

Returns: The result as a Java object

numberValue

public double numberValue()
Returns the result as a number value.

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()