net.sf.saxon.value
public final class DoubleValue extends NumericValue
| Field Summary | |
|---|---|
| static Pattern | nonExponentialPattern |
| static DoubleValue | NaN |
| static DoubleValue | ZERO |
| Constructor Summary | |
|---|---|
| DoubleValue(CharSequence val)
Constructor supplying a string | |
| DoubleValue(double value)
Constructor supplying a double | |
| Method Summary | |
|---|---|
| NumericValue | arithmetic(int operator, NumericValue other, XPathContext context)
Evaluate a binary arithmetic operator. |
| NumericValue | ceiling()
Implement the XPath ceiling() function |
| AtomicValue | convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type |
| Object | convertToJava(Class target, XPathContext context)
Convert to Java object (for passing to external functions) |
| static CharSequence | doubleToString(double value)
Internal method used for conversion of a double to a string |
| static CharSequence | doubleToStringOLD(double value, String javaString)
Internal method used for conversion of a double to a string |
| boolean | effectiveBooleanValue(XPathContext context)
Get the effective boolean value |
| NumericValue | floor()
Implement the XPath floor() function |
| double | getDoubleValue()
Return this numeric value as a double |
| ItemType | getItemType(TypeHierarchy th)
Determine the data type of the expression |
| String | getStringValue()
Convert the double to a string according to the XPath 2.0 rules |
| CharSequence | getStringValueCS()
Convert the double to a string according to the XPath 2.0 rules |
| int | hashCode()
Get the hashCode. |
| boolean | isNaN()
Test whether the value is the double/float value NaN |
| boolean | isWholeNumber()
Determine whether the value is a whole number, that is, whether it compares
equal to some integer |
| NumericValue | negate()
Negate the value |
| static void | printInternalForm(double d)
Diagnostic method |
| NumericValue | round()
Implement the XPath round() function |
| NumericValue | roundToHalfEven(int scale)
Implement the XPath round-to-half-even() function |
| boolean | schemaEquals(Value obj)
Compare two values for equality. |
| double | signum()
Determine whether the value is negative, zero, or positive |
| static String | zeros(int n) |
Throws: ValidationException if the string does not have the correct lexical form for a double. Note that the error will contain no error code or context information.
Parameters: value the value of the NumericValue
Parameters: requiredType an integer identifying the required atomic type context
Returns: an AtomicValue, a value of the required type
Parameters: value the actual value
Returns: the value converted to a string, according to the XPath casting rules.
Parameters: value the actual value javaString the result of converting the double to a string using the Java conventions. This value is adjusted as necessary to cater for the differences between the Java and XPath rules.
Returns: the value converted to a string, according to the XPath casting rules.
Parameters: context
Returns: the effective boolean value (true unless the value is zero or NaN)
Returns: the value as a double
Parameters: th
Returns: Type.DOUBLE
Returns: the string value
Returns: the string value
See Also: NumericValue
Returns: -1 if negative, 0 if zero (including negative zero), +1 if positive, NaN if NaN