Package org.exolab.adaptx.xpath
Class NumberResult
java.lang.Object
org.exolab.adaptx.xpath.XPathResult
org.exolab.adaptx.xpath.NumberResult
- All Implemented Interfaces:
Serializable
Represents a number result. This is an immutable object.
- Version:
- $Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NumberResult
Number result representingDouble.NaN
(not a number).Fields inherited from class org.exolab.adaptx.xpath.XPathResult
BOOLEAN, NODE_SET, NUMBER, STRING, USER_DEFINED
-
Constructor Summary
ConstructorsConstructorDescriptionNumberResult
(double value) Creates a new number result with the given value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Returns the type of this result.Returns the result as a Java object.double
Returns the result as a number value.Returns the result as a string value.toString()
-
Field Details
-
NaN
Number result representingDouble.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
-
getResultType
public int getResultType()Returns the type of this result.- Specified by:
getResultType
in classXPathResult
- Returns:
XPathResult.NUMBER
-
booleanValue
public boolean booleanValue()Returns the result as a boolean value. Returns true if the number value is not zero.- Specified by:
booleanValue
in classXPathResult
- Returns:
- The result as a boolean value
-
numberValue
public double numberValue()Returns the result as a number value.- Specified by:
numberValue
in classXPathResult
- Returns:
- The result as a number value
-
stringValue
Returns the result as a string value.- Specified by:
stringValue
in classXPathResult
- Returns:
- The result as a string value
-
javaObject
Returns the result as a Java object. Returns an object of typeDouble
with the same number value.- Specified by:
javaObject
in classXPathResult
- Returns:
- The result as a Java object
-
equals
Returns true if the given result is a number result and has the same number value.- Specified by:
equals
in classXPathResult
- Parameters:
result
- An XPath result- Returns:
- True if a number result and has same value
-
toString
-