Package org.exolab.adaptx.xpath
Class NumberResult
- java.lang.Object
-
- org.exolab.adaptx.xpath.XPathResult
-
- org.exolab.adaptx.xpath.NumberResult
-
- All 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 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static NumberResultNaNNumber result representingDouble.NaN(not a number).-
Fields inherited from class org.exolab.adaptx.xpath.XPathResult
BOOLEAN, NODE_SET, NUMBER, STRING, USER_DEFINED
-
-
Constructor Summary
Constructors Constructor Description NumberResult(double value)Creates a new number result with the given value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.lang.ObjectjavaObject()Returns the result as a Java object.doublenumberValue()Returns the result as a number value.java.lang.StringstringValue()Returns the result as a string value.java.lang.StringtoString()
-
-
-
Field Detail
-
NaN
public static final NumberResult NaN
Number result representingDouble.NaN(not a number).
-
-
Method Detail
-
getResultType
public int getResultType()
Returns the type of this result.- Specified by:
getResultTypein 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:
booleanValuein classXPathResult- Returns:
- The result as a boolean value
-
numberValue
public double numberValue()
Returns the result as a number value.- Specified by:
numberValuein classXPathResult- Returns:
- The result as a number value
-
stringValue
public java.lang.String stringValue()
Returns the result as a string value.- Specified by:
stringValuein classXPathResult- Returns:
- The result as a string value
-
javaObject
public java.lang.Object javaObject()
Returns the result as a Java object. Returns an object of typeDoublewith the same number value.- Specified by:
javaObjectin classXPathResult- Returns:
- The result as a Java object
-
equals
public boolean equals(XPathResult result)
Returns true if the given result is a number result and has the same number value.- Specified by:
equalsin classXPathResult- Parameters:
result- An XPath result- Returns:
- True if a number result and has same value
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-