本文整理了Java中java.lang.reflect.Array.createMultiArray()
方法的一些代码示例,展示了Array.createMultiArray()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Array.createMultiArray()
方法的具体详情如下:
包路径:java.lang.reflect.Array
类名称:Array
方法名:createMultiArray
暂无
代码示例来源:origin: robovm/robovm
/**
* 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);
}
代码示例来源:origin: ibinti/bugvm
/**
* 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);
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* 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);
}
代码示例来源:origin: MobiVM/robovm
/**
* 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);
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* 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);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* 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);
}
代码示例来源:origin: FlexoVM/flexovm
/**
* 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);
}
内容来源于网络,如有侵权,请联系作者删除!