Class BooleanResult

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

public final class BooleanResult extends XPathResult
Represents a boolean 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

    • FALSE

      public static final BooleanResult FALSE
      Boolean result representing false.
    • TRUE

      public static final BooleanResult TRUE
      Boolean result representing true.
  • Method Details

    • from

      public static BooleanResult from(boolean value)
      Returns a boolean result from a boolean value. Use this method in lieu of the constructor.
      Parameters:
      boolean - The boolean value
      Returns:
      A boolean result
    • from

      public static BooleanResult from(XPathResult result)
      Returns a boolean result from an XPath result. Return true if the XPath result is a numeric value that is not zero or Double.NaN, a non-empty string, or a non-empty NodeSet.
      Parameters:
      result - An XPath result
      Returns:
      A boolean result
    • getResultType

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

      public boolean booleanValue()
      Returns the result as a boolean value.
      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 0 for false, 1 for true.
      Specified by:
      numberValue in class XPathResult
      Returns:
      The result as a number value
    • stringValue

      public String stringValue()
      Returns the result as a string value. Returns "false" or "true".
      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 Boolean with the same boolean 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 boolean result and has the same boolean value.
      Specified by:
      equals in class XPathResult
      Parameters:
      result - An XPath result
      Returns:
      True if a boolean result and has same value
    • toString

      public String toString()
      Overrides:
      toString in class Object