Class StringResult

java.lang.Object
org.exolab.adaptx.xpath.XPathResult
org.exolab.adaptx.xpath.StringResult
All Implemented Interfaces:
Serializable

public final class StringResult extends XPathResult
Represents a string 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

    • EMPTY

      public static final StringResult EMPTY
      String result representing an empty string.
  • Constructor Details

    • StringResult

      public StringResult()
      Creates a new string result with an empty string as it's value.
    • StringResult

      public StringResult(String value)
      Creates a new string result with the given value.
      Parameters:
      value - The string value (not null)
  • Method Details

    • getResultType

      public int getResultType()
      Returns the type of this result.
      Specified by:
      getResultType in class XPathResult
      Returns:
      XPathResult.STRING
    • booleanValue

      public boolean booleanValue()
      Returns the result as a boolean value. Returns true if not an empty string.
      Specified by:
      booleanValue in class XPathResult
      Returns:
      The result as a boolean value
    • numberValue

      public double numberValue()
      Returns the result as a number value. Returns Double.NaN if the value is not a valid number.
      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 String with the same string 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 string result and has the same string value.
      Specified by:
      equals in class XPathResult
      Parameters:
      result - An XPath result
      Returns:
      True if a string result and has same value
    • toString

      public String toString()
      Returns the String representation of this XPathResult
      Overrides:
      toString in class Object
      Returns:
      the String representation of this XPathResult