Package com.humaorie.dollar.ArrayWrapper

Examples of com.humaorie.dollar.ArrayWrapper.ShortArrayWrapper


        T[] array = toArray();
        Class<?> componentType = array.getClass().getComponentType();
        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)) {
View Full Code Here


    }

    @Test
    public void boxShortArray() {
        short[] unboxed = new short[]{42, 42, 42};
        ShortArrayWrapper arrayWrapper = new ShortArrayWrapper(unboxed);
        Assert.assertArrayEquals(new Short[]{42, 42, 42}, arrayWrapper.toArray());
    }
View Full Code Here

    @Test
    public void unboxShortArray() {
        final Short[] boxed = {42};
        final short[] unboxed = {42};
        final ShortArrayWrapper arrayWrapper = new ShortArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toShortArray());
    }
View Full Code Here

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

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

    @Test
    public void unboxShortArrayWithNulls() {
        final Short[] boxed = {null};
        final short[] unboxed = {0};
        final ShortArrayWrapper arrayWrapper = new ShortArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toShortArray());
    }
View Full Code Here

TOP

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

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.