Class NumberResult

java.lang.Object
org.exolab.adaptx.xpath.XPathResult
org.exolab.adaptx.xpath.NumberResult
All Implemented Interfaces:
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:
  • Field Details

  • 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 class XPathResult
      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 class XPathResult
      Returns:
      The result as a boolean value
    • numberValue

      public double numberValue()
      Returns the result as a number value.
      Specified by:
      numberValue in class XPathResult
      Returns:
      The result as a number value
    • stringValue

      public String stringValue()
      Returns the result as a string value.
      Specified by:
      stringValue in class XPathResult
      Returns:
      The result as a string value
    • javaObject

      public Object javaObject()
      Returns the result as a Java object. Returns an object of type Double with the same number value.
      Specified by:
      javaObject in class XPathResult
      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:
      equals in class XPathResult
      Parameters:
      result - An XPath result
      Returns:
      True if a number result and has same value
    • toString

      public String toString()
      Overrides:
      toString in class Object