Class BooleanResult
java.lang.Object
org.exolab.adaptx.xpath.XPathResult
org.exolab.adaptx.xpath.BooleanResult
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanResultBoolean result representing false.static final BooleanResultBoolean result representing true.Fields inherited from class XPathResult
BOOLEAN, NODE_SET, NUMBER, STRING, USER_DEFINED -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the result as a boolean value.booleanequals(XPathResult result) Returns true if the given result is a boolean result and has the same boolean value.static BooleanResultfrom(boolean value) Returns a boolean result from a boolean value.static BooleanResultfrom(XPathResult result) Returns a boolean result from an XPath result.intReturns the type of this result.Returns the result as a Java object.doubleReturns the result as a number value.Returns the result as a string value.toString()
-
Field Details
-
FALSE
Boolean result representing false. -
TRUE
Boolean result representing true.
-
-
Method Details
-
from
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
Returns a boolean result from an XPath result. Return true if the XPath result is a numeric value that is not zero orDouble.NaN, a non-empty string, or a non-emptyNodeSet.- Parameters:
result- An XPath result- Returns:
- A boolean result
-
getResultType
public int getResultType()Returns the type of this result.- Specified by:
getResultTypein classXPathResult- Returns:
XPathResult.BOOLEAN
-
booleanValue
public boolean booleanValue()Returns the result as a boolean value.- Specified by:
booleanValuein classXPathResult- 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:
numberValuein classXPathResult- Returns:
- The result as a number value
-
stringValue
Returns the result as a string value. Returns "false" or "true".- Specified by:
stringValuein classXPathResult- Returns:
- The result as a string value
-
javaObject
Returns the result as a Java object. Returns an object of typeBooleanwith the same boolean value.- Specified by:
javaObjectin classXPathResult- Returns:
- The result as a Java object
-
equals
Returns true if the given result is a boolean result and has the same boolean value.- Specified by:
equalsin classXPathResult- Parameters:
result- An XPath result- Returns:
- True if a boolean result and has same value
-
toString
-