Package com.humaorie.dollar.ArrayWrapper

Examples of com.humaorie.dollar.ArrayWrapper.DoubleArrayWrapper


        } else if (componentType.equals(Boolean.class)) {
            return (ArrayWrapper<T>) new BooleanArrayWrapper((Boolean[]) array);
        } else if (componentType.equals(Float.class)) {
            return (ArrayWrapper<T>) new FloatArrayWrapper((Float[]) array);
        } else if (componentType.equals(Double.class)) {
            return (ArrayWrapper<T>) new DoubleArrayWrapper((Double[]) array);
        } else {
            throw new IllegalArgumentException("cannot convert() array of "
                    + componentType.toString());
        }
    }
View Full Code Here


    }

    @Test
    public void boxDoubleArray() {
        double[] unboxed = new double[]{42.0, 42.0, 42.0};
        DoubleArrayWrapper arrayWrapper = new DoubleArrayWrapper(unboxed);
        Assert.assertArrayEquals(new Double[]{42D, 42D, 42D}, arrayWrapper.toArray());
    }
View Full Code Here

    @Test
    public void unboxDoubleArray() {
        final Double[] boxed = {42.0};
        final double[] unboxed = {42};
        final DoubleArrayWrapper arrayWrapper = new DoubleArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toDoubleArray(), 0.1d);
    }
View Full Code Here

    @Test
    public void unboxDoubleArrayWithNullsLeadsToZero() {
        final Double[] boxed = {null};
        final double[] unboxed = {0};
        final DoubleArrayWrapper arrayWrapper = new DoubleArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toDoubleArray(), 0.1d);
    }
View Full Code Here

TOP

Related Classes of com.humaorie.dollar.ArrayWrapper.DoubleArrayWrapper

Copyright © 2018 www.massapicom. 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.