Java Object Array Create toObjectArray(boolean[] primitiveArray)

Here you can find the source of toObjectArray(boolean[] primitiveArray)

Description

to Object Array

License

Open Source License

Declaration

public static Boolean[] toObjectArray(boolean[] primitiveArray) 

Method Source Code

//package com.java2s;

public class Main {
    public static Boolean[] toObjectArray(boolean[] primitiveArray) {
        final Boolean[] objects = new Boolean[primitiveArray.length];
        int index = 0;
        for (boolean b : primitiveArray)
            objects[index++] = Boolean.valueOf(b);
        return objects;
    }//www .  j av  a  2s.c  o  m

    public static Integer[] toObjectArray(int[] primitiveArray) {
        final Integer[] objects = new Integer[primitiveArray.length];
        int index = 0;
        for (int v : primitiveArray)
            objects[index++] = Integer.valueOf(v);
        return objects;
    }

    public static Double[] toObjectArray(double[] primitiveArray) {
        final Double[] objects = new Double[primitiveArray.length];
        int index = 0;
        for (double b : primitiveArray)
            objects[index++] = Double.valueOf(b);
        return objects;
    }
}

Related

  1. toObjectArray(boolean arr[])
  2. toObjectArray(byte[] array)
  3. toObjectArray(char... array)
  4. toObjectArray(int[] array)
  5. toObjectArray(int[] array)