List of utility methods to do Array Dimension Get
int | arrayDim(Class> c) array Dim if (c.isArray() && !c.getComponentType().isArray()) return 1; else return 1 + arrayDim(c.getComponentType()); |
int | arrayDimension(String clsName) Computes the dimension of the array class specified by name. int arrayDim = 0; if (clsName.startsWith("[")) { for (int i = 0; i < clsName.length(); i++) { if (clsName.charAt(i) != '[') { break; arrayDim = i + 1; return arrayDim; |
int | arrayDimensions(Class> arrayClass) Get the dimension of an array verifyIsArray(arrayClass); return arrayClass.getName().lastIndexOf("[") + 1; |
int | arrayDimensions(Class> c) Return the number of array dimensions represented by the given class. Class<?> rest = c; int result = 0; while (rest.isArray()) { rest = rest.getComponentType(); result++; return result; |
int[] | arraysDims(String[] arr) arrays Dims if (arr.length > 1) { int[] idx = new int[arr.length - 1]; for (int i = 1; i < arr.length; i++) { idx[i - 1] = Integer.parseInt(arr[i]); return idx; return null; ... |