Package com.humaorie.dollar.ArrayWrapper

Examples of com.humaorie.dollar.ArrayWrapper.IntegerArrayWrapper


        if (componentType.equals(Byte.class)) {
            return (ArrayWrapper<T>) new ByteArrayWrapper((Byte[]) array);
        } else if (componentType.equals(Short.class)) {
            return (ArrayWrapper<T>) new ShortArrayWrapper((Short[]) array);
        } else if (componentType.equals(Integer.class)) {
            return (ArrayWrapper<T>) new IntegerArrayWrapper((Integer[]) array);
        } else if (componentType.equals(Long.class)) {
            return (ArrayWrapper<T>) new LongArrayWrapper((Long[]) array);
        } else if (componentType.equals(Character.class)) {
            return (ArrayWrapper<T>) new CharArrayWrapper((Character[]) array);
        } else if (componentType.equals(Boolean.class)) {
View Full Code Here


    }

    @Test
    public void boxIntArray() {
        int[] unboxed = new int[]{42, 42, 42};
        IntegerArrayWrapper arrayWrapper = new IntegerArrayWrapper(unboxed);
        Assert.assertArrayEquals(new Integer[]{42, 42, 42}, arrayWrapper.toArray());
    }
View Full Code Here

    @Test
    public void unboxIntegerArray() {
        final Integer[] boxed = {42};
        final int[] unboxed = {42};
        final IntegerArrayWrapper arrayWrapper = new IntegerArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toIntArray());
    }
View Full Code Here

    @Test
    public void unboxIntegerArrayWithNulls() {
        final Integer[] boxed = {null};
        final int[] unboxed = {0};
        final IntegerArrayWrapper arrayWrapper = new IntegerArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toIntArray());
    }
View Full Code Here

    @Test
    public void unboxIntegerArrayToLongArray() {
        final Integer[] boxed = {42};
        final long[] unboxed = {42};
        final IntegerArrayWrapper arrayWrapper = new IntegerArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toLongArray());
    }
View Full Code Here

    @Test
    public void unboxIntegerArrayToFloatArray() {
        final Integer[] boxed = { 42 };
        final float[] unboxed = { 42f };
        final IntegerArrayWrapper arrayWrapper = new IntegerArrayWrapper(
                boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toFloatArray(), 0.001f);
    }
View Full Code Here

    @Test
    public void unboxIntegerArrayToDoubleArray() {
        final Integer[] boxed = { 42 };
        final double[] unboxed = { 42.0 };
        final IntegerArrayWrapper arrayWrapper = new IntegerArrayWrapper(
                boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toDoubleArray(), 0.001);
    }
View Full Code Here

        new LazyMappedWrapper<String, Integer>(new RangeWrapper(1), null);
    }

    @Test
    public void appliesMapperToEveryElementProvidedByDelegate() {
        LazyMappedWrapper<String, Integer> wrapper = new LazyMappedWrapper<String, Integer>(new IntegerArrayWrapper(new int[]{1}), new IntegerToString());
        Iterator<String> iterator = wrapper.iterator();
        Assert.assertEquals("1", iterator.next());
    }
View Full Code Here

TOP

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

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.