Class NumericValue
java.lang.Object
com.icl.saxon.expr.Expression
com.icl.saxon.expr.Value
com.icl.saxon.expr.NumericValue
A numeric (floating point) value
-
Field Summary
Fields inherited from class Expression
staticContext -
Constructor Summary
ConstructorsConstructorDescriptionNumericValue(double value) Constructor supplying a doubleConstructor supplying a String -
Method Summary
Modifier and TypeMethodDescriptionbooleanConvert the value to a booleandoubleasNumber()Get the value as a numberasString()Get the value as a StringGet the value as a StringintconversionPreference(Class required) Get conversion preference for this value to a Java class.convertToJava(Class target) Convert to Java object (for passing to external functions)voiddisplay(int level) Diagnostic print of expression structureintDetermine the data type of the exprssion, if possibleMethods inherited from class Value
compare, equals, evaluate, getDependencies, inverse, notEquals, numericCompare, reduce, simplify, stringToNumberMethods inherited from class Expression
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrent
-
Constructor Details
-
NumericValue
public NumericValue(double value) Constructor supplying a double -
NumericValue
Constructor supplying a String
-
-
Method Details
-
asStringOLD
-
asString
-
asNumber
-
asBoolean
-
getDataType
public int getDataType()Determine the data type of the exprssion, if possible- Specified by:
getDataTypein classExpression- Returns:
- one of the values Value.STRING, Value.BOOLEAN, Value.NUMBER, Value.NODESET, Value.FRAGMENT, or Value.ANY (meaning not known in advance)
-
conversionPreference
Get conversion preference for this value to a Java class. A low result indicates higher preference.- Specified by:
conversionPreferencein classValue
-
convertToJava
Convert to Java object (for passing to external functions)- Specified by:
convertToJavain classValue- Parameters:
target- The class required by the external function- Returns:
- an object of the target class
- Throws:
XPathException
-
display
public void display(int level) Diagnostic print of expression structure- Specified by:
displayin classExpression
-