Package com.humaorie.dollar.ArrayWrapper

Examples of com.humaorie.dollar.ArrayWrapper.FloatArrayWrapper


        } else if (componentType.equals(Character.class)) {
            return (ArrayWrapper<T>) new CharArrayWrapper((Character[]) array);
        } 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 boxFloatArray() {
        float[] unboxed = new float[]{42.0f, 42.0f, 42.0f};
        FloatArrayWrapper arrayWrapper = new FloatArrayWrapper(unboxed);
        Assert.assertArrayEquals(new Float[]{42F, 42F, 42F}, arrayWrapper.toArray());
    }
View Full Code Here

    @Test
    public void unboxFloatArray() {
        final Float[] boxed = {42.0f};
        final float[] unboxed = {42};
        final FloatArrayWrapper arrayWrapper = new FloatArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toFloatArray(), 0.1f);
    }
View Full Code Here

    @Test
    public void unboxFloatArrayToDoubleArray() {
        final Float[] boxed = {42f};
        final double[] unboxed = {42};
        final FloatArrayWrapper arrayWrapper = new FloatArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toDoubleArray(), 0.1d);
    }
View Full Code Here

    @Test
    public void unboxFloatArrayWithNulls() {
        final Float[] boxed = {null};
        final float[] unboxed = {0};
        final FloatArrayWrapper arrayWrapper = new FloatArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toFloatArray(), 0.1f);
    }
View Full Code Here

TOP

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

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.