Examples of DoubleValue


Examples of net.sf.saxon.value.DoubleValue

            BuiltInAtomicType itemType = soughtValue.getPrimitiveType();
            if (itemType.equals(BuiltInAtomicType.INTEGER) ||
                    itemType.equals(BuiltInAtomicType.DECIMAL) ||
                    itemType.equals(BuiltInAtomicType.FLOAT)) {
                soughtValue = new DoubleValue(((NumericValue)soughtValue).getDoubleValue());
            }
        }

        // If the sought value is untypedAtomic and the equality matching mode is
        // "convertUntypedToOther", then we construct and search one index for each
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

            if (position++ >= count) {
                current = null;
                position = -1;
                return null;
            } else {
                current = new DoubleValue(generator.nextDouble());
                return current;
            }
        }
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

        // If either operand is a number, convert both operands to xs:double using
        // the rules of the number() function, and compare them

        if (t0.isPrimitiveNumeric() || t1.isPrimitiveNumeric()) {
            DoubleValue v0 = NumberFn.convert(a0);
            DoubleValue v1 = NumberFn.convert(a1);
            return ValueComparison.compare(v0, operator, v1, comparer, false);
        }

        // If either operand is a string, or if both are untyped atomic, convert
        // both operands to strings and compare them
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

        public Item next() {
            if (position++ >= count) {
                return null;
            } else {
                current = new DoubleValue(generator.nextDouble());
                return current;
            }
        }
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

        if (arg0 instanceof BooleanValue || arg0 instanceof NumericValue) {
            return ((AtomicValue)arg0).convert(Type.DOUBLE, context);
        }
        String s = arg0.getStringValue();
        try {
            return new DoubleValue(Value.stringToNumber(s));
        } catch (NumberFormatException e) {
            return DoubleValue.NaN;
        }
    }
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

            }
            if (value instanceof BooleanValue || value instanceof NumericValue) {
                return (DoubleValue)value.convert(Type.DOUBLE, null);
            }
            String s = value.getStringValue();
            return new DoubleValue(Value.stringToNumber(s));
        } catch (NumberFormatException e) {
            return DoubleValue.NaN;
        } catch (XPathException e) {
            return DoubleValue.NaN;
        }
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

            AtomicValue test = (AtomicValue)iter.next();
            if (test==null) break;
            AtomicValue test2 = test;
            if (test instanceof UntypedAtomicValue) {
                try {
                    test2 = new DoubleValue(Value.stringToNumber(test.getStringValue()));
                } catch (NumberFormatException e) {
                    dynamicError("Failure converting " +
                                                     Err.wrap(test.getStringValue()) +
                                                     " to a number", context);
                }
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

        } else if (source instanceof Short) {
            result = new IntegerValue((Short)source);
        } else if (source instanceof Byte) {
            result = new IntegerValue((Byte)source);
        } else if (source instanceof Double) {
            result = new DoubleValue((Double)source);
        } else if (source instanceof Float) {
            result = new FloatValue((Float)source);
        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

    } else if(source instanceof Short) {
      result = IntegerValue.makeIntegerValue(BigInteger.valueOf(((Short)source)));
    } else if(source instanceof Byte) {
      result = IntegerValue.makeIntegerValue(BigInteger.valueOf(((Byte)source)));
    } else if(source instanceof Double) {
      result = new DoubleValue((Double)source);
    } else if(source instanceof Float) {
      result = new FloatValue((Float)source);
    } else if(source instanceof BigDecimal) {
      result = new DecimalValue((BigDecimal)source);
    } else if(source instanceof String) {
View Full Code Here

Examples of net.sf.saxon.value.DoubleValue

            BuiltInAtomicType itemType = soughtValue.getPrimitiveType();
            if (itemType.equals(BuiltInAtomicType.INTEGER) ||
                    itemType.equals(BuiltInAtomicType.DECIMAL) ||
                    itemType.equals(BuiltInAtomicType.FLOAT)) {
                soughtValue = new DoubleValue(((NumericValue)soughtValue).getDoubleValue());
            }
        }

        // If the sought value is untypedAtomic and the equality matching mode is
        // "convertUntypedToOther", then we construct and search one index for each
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.