Examples of asJavaDouble()


Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue.asJavaDouble()

        // invoke the method
        DoubleValue result = PipelineExpressionHelper.fnNumber(Sequence.EMPTY,
                                                       factory);
        // check the result
        assertTrue("unexpected number result",
                   Double.isNaN(result.asJavaDouble()));

    }

    /**
     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue.asJavaDouble()

     */
    public void testNumberWithNaNStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("NaN").getSequence();
        DoubleValue result = PipelineExpressionHelper.fnNumber(seq, factory);
        assertTrue("number('NaN') should return NaN DoubleValue",
                   Double.isNaN(result.asJavaDouble()));
    }

    /**
     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of one "-inf" StringValue item
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue.asJavaDouble()

     */
    public void testNumberWithinValidDoubleStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("fred").getSequence();
        DoubleValue result = PipelineExpressionHelper.fnNumber(seq, factory);
        assertTrue("number('fred') should return NaN DoubleValue",
                   Double.isNaN(result.asJavaDouble()));
    }

    /**
     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of several Items
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue.asJavaDouble()

        // invoke the method
        DoubleValue result = PipelineExpressionHelper.fnNumber(sequence, factory);
        // check the result
        assertEquals("unexpected number result",
                     expected,
                     result.asJavaDouble(),
                     0.1);

    }

    /**
 
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue.asJavaDouble()

     * @return The value as an int.
     */
    private int getIntRound(Value value) {
        if (value instanceof DoubleValue) {
            DoubleValue doubleValue = (DoubleValue) value;
            return (int) Math.round(doubleValue.asJavaDouble());
        } else if (value instanceof IntValue) {
            IntValue intValue = (IntValue) value;
            return intValue.asJavaInt();
        } else {
            throw new IllegalArgumentException(
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.