Class StringResult
java.lang.Object
org.exolab.adaptx.xpath.XPathResult
org.exolab.adaptx.xpath.StringResult
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringResultString result representing an empty string.Fields inherited from class XPathResult
BOOLEAN, NODE_SET, NUMBER, STRING, USER_DEFINED -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new string result with an empty string as it's value.StringResult(String value) Creates a new string result with the given value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the result as a boolean value.booleanequals(XPathResult result) Returns true if the given result is a string result and has the same string value.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()Returns the String representation of this XPathResult
-
Field Details
-
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
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:
getResultTypein classXPathResult- Returns:
XPathResult.STRING
-
booleanValue
public boolean booleanValue()Returns the result as a boolean value. Returns true if not an empty string.- Specified by:
booleanValuein classXPathResult- Returns:
- The result as a boolean value
-
numberValue
public double numberValue()Returns the result as a number value. ReturnsDouble.NaNif the value is not a valid number.- Specified by:
numberValuein classXPathResult- Returns:
- The result as a number value
-
stringValue
Returns the result as a string value.- Specified by:
stringValuein classXPathResult- Returns:
- The result as a string value
-
javaObject
Returns the result as a Java object. Returns an object of typeStringwith the same string value.- Specified by:
javaObjectin classXPathResult- Returns:
- The result as a Java object
-
equals
Returns true if the given result is a string result and has the same string value.- Specified by:
equalsin classXPathResult- Parameters:
result- An XPath result- Returns:
- True if a string result and has same value
-
toString
-