org.exolab.adaptx.xpath

Class NumberResult

Implemented Interfaces:
java.io.Serializable

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
See Also:
Serialized Form

Field Summary

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

Fields inherited from class org.exolab.adaptx.xpath.XPathResult

BOOLEAN, NODE_SET, NUMBER, STRING, USER_DEFINED

Constructor Summary

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

Method Summary

boolean
booleanValue()
Returns the result as a boolean value.
boolean
equals(XPathResult result)
Returns true if the given result is a number result and has the same number value.
int
getResultType()
Returns the type of this result.
Object
javaObject()
Returns the result as a Java object.
double
numberValue()
Returns the result as a number value.
String
stringValue()
Returns the result as a string value.
String
toString()

Methods inherited from class org.exolab.adaptx.xpath.XPathResult

booleanValue, equals, getResultType, javaObject, numberValue, stringValue

Field Details

NaN

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

Constructor Details

NumberResult

public NumberResult(double value)
Creates a new number result with the given value.
Parameters:
value - The number value

Method Details

booleanValue

public boolean booleanValue()
Returns the result as a boolean value. Returns true if the number value is not zero.
Overrides:
booleanValue in interface XPathResult
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.
Overrides:
equals in interface XPathResult
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.
Overrides:
getResultType in interface XPathResult

javaObject

public Object javaObject()
Returns the result as a Java object. Returns an object of type java.lang.Double with the same number value.
Overrides:
javaObject in interface XPathResult
Returns:
The result as a Java object

numberValue

public double numberValue()
Returns the result as a number value.
Overrides:
numberValue in interface XPathResult
Returns:
The result as a number value

stringValue

public String stringValue()
Returns the result as a string value.
Overrides:
stringValue in interface XPathResult
Returns:
The result as a string value

toString

public String toString()