weka.core.Utils.getArrayDimensions()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中weka.core.Utils.getArrayDimensions()方法的一些代码示例,展示了Utils.getArrayDimensions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getArrayDimensions()方法的具体详情如下:
包路径:weka.core.Utils
类名称:Utils
方法名:getArrayDimensions

Utils.getArrayDimensions介绍

[英]Returns the dimensions of the given array. Even though the parameter is of type "Object" one can hand over primitve arrays, e.g. int[3] or double[2][4].
[中]返回给定数组的维数。即使参数的类型为“Object”,也可以移交primitve数组,例如int[3]或double[2][4]。

代码示例

代码示例来源:origin: Waikato/weka-trunk

/**
 * Returns the dimensions of the given array. Even though the parameter is of
 * type "Object" one can hand over primitve arrays, e.g. int[3] or
 * double[2][4].
 * 
 * @param array the array to determine the dimensions for
 * @return the dimensions of the array
 */
public static int getArrayDimensions(Object array) {
 return getArrayDimensions(array.getClass());
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns the dimensions of the given array. Even though the parameter is of
 * type "Object" one can hand over primitve arrays, e.g. int[3] or
 * double[2][4].
 * 
 * @param array the array to determine the dimensions for
 * @return the dimensions of the array
 */
public static int getArrayDimensions(Object array) {
 return getArrayDimensions(array.getClass());
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Returns the dimensions of the given array. Even though the parameter is of
 * type "Object" one can hand over primitve arrays, e.g. int[3] or
 * double[2][4].
 * 
 * @param array the array to determine the dimensions for
 * @return the dimensions of the array
 */
public static int getArrayDimensions(Class<?> array) {
 if (array.getComponentType().isArray()) {
  return 1 + getArrayDimensions(array.getComponentType());
 } else {
  return 1;
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns the dimensions of the given array. Even though the parameter is of
 * type "Object" one can hand over primitve arrays, e.g. int[3] or
 * double[2][4].
 * 
 * @param array the array to determine the dimensions for
 * @return the dimensions of the array
 */
public static int getArrayDimensions(Class<?> array) {
 if (array.getComponentType().isArray()) {
  return 1 + getArrayDimensions(array.getComponentType());
 } else {
  return 1;
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

dimensions = getArrayDimensions(array);

代码示例来源:origin: Waikato/weka-trunk

dimensions = getArrayDimensions(array);

代码示例来源:origin: Waikato/weka-trunk

array = Utils.getArrayDimensions(o);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

array = Utils.getArrayDimensions(o);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

+ Utils.getArrayDimensions(new int[][] {}));
 System.out.println("Array-Dimensions of 'new int[][]{{1,2,3},{4,5,6}}': "
  + Utils.getArrayDimensions(new int[][] { { 1, 2, 3 }, { 4, 5, 6 } }));
 String[][][] s = new String[3][4][];
 System.out.println("Array-Dimensions of 'new String[3][4][]': "
  + Utils.getArrayDimensions(s));
} catch (Exception e) {
 e.printStackTrace();

代码示例来源:origin: Waikato/weka-trunk

+ Utils.getArrayDimensions(new int[][] {}));
 System.out.println("Array-Dimensions of 'new int[][]{{1,2,3},{4,5,6}}': "
  + Utils.getArrayDimensions(new int[][] { { 1, 2, 3 }, { 4, 5, 6 } }));
 String[][][] s = new String[3][4][];
 System.out.println("Array-Dimensions of 'new String[3][4][]': "
  + Utils.getArrayDimensions(s));
} catch (Exception e) {
 e.printStackTrace();

相关文章