org.exolab.adaptx.xpath
Class BooleanResult
- java.io.Serializable
public final class BooleanResult
Represents a boolean result. This is an immutable object.
Version:
- Keith Visco
- Serialized Form
FALSE
public static final BooleanResult FALSE
Boolean result representing false.
TRUE
public static final BooleanResult TRUE
Boolean result representing true.
booleanValue
public boolean booleanValue()
Returns the result as a boolean value.
- booleanValue in interface XPathResult
- The result as a boolean value
equals
public boolean equals(XPathResult result)
Returns true if the given result is a boolean result
and has the same boolean value.
- equals in interface XPathResult
result
- An XPath result
- True if a boolean result and has same value
from
public static BooleanResult from(boolean value)
Returns a boolean result from a boolean value. Use this method
in lieu of the constructor.
- 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
java.lang.Double.NaN
,
a non-empty string, or a non-empty
NodeSet
.
result
- An XPath result
- A boolean result
javaObject
public Object javaObject()
Returns the result as a Java object. Returns an object of
type java.lang.Boolean
with the same boolean value.
- javaObject in interface XPathResult
- The result as a Java object
numberValue
public double numberValue()
Returns the result as a number value. Returns 0 for
false, 1 for true.
- numberValue in interface XPathResult
- The result as a number value
stringValue
public String stringValue()
Returns the result as a string value. Returns "false" or
"true".
- stringValue in interface XPathResult
- The result as a string value
toString
public String toString()