/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }
/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }
/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }
/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }
/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }
/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }
/** * Returns a new multidimensional array of the specified component type and * dimensions. Equivalent to {@code new componentType[d0][d1]...[dn]} for a * dimensions array of { d0, d1, ... , dn }. * * @throws NullPointerException if {@code array == null} * @throws NegativeArraySizeException * if any of the dimensions are negative * @throws IllegalArgumentException * if the array of dimensions is of size zero, or exceeds the * limit of the number of dimension for an array (currently 255) */ public static Object newInstance(Class<?> componentType, int... dimensions) throws NegativeArraySizeException, IllegalArgumentException { if (dimensions.length <= 0 || dimensions.length > 255) { throw new IllegalArgumentException("Bad number of dimensions: " + dimensions.length); } if (componentType == void.class) { throw new IllegalArgumentException("Can't allocate an array of void"); } if (componentType == null) { throw new NullPointerException("componentType == null"); } return createMultiArray(componentType, dimensions); }