List of utility methods to do Array Length Get
int | length(Object[] array) length if (array == null) return 0; return array.length; |
int | length(Object[] array) Null-safe operation to determine an array's length. return array != null ? array.length : 0;
|
int | length(Object[] array) length if (isEmpty(array)) { return 0; return array.length; |
int | length(Object[] buf) length return buf.length;
|
int | length(String[] arr) length if (arr == null || arr.length == 0) return 0; int sum = 0; for (String s : arr) sum += length(s); return sum; |
int | length(T[] a) length return a == null ? 0 : a.length;
|
float | length3(float[] a) length return (float) Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); |
int[] | lengthArray(Object[][] arr) Returns an array of the lengths of the sub-arrays of a given array. if (arr == null) { return null; int[] ret = new int[arr.length]; for (int i = 0; i < arr.length; i++) { ret[i] = (arr[i] != null) ? arr[i].length : 0; return ret; ... |
boolean | lengthCheck(double[] src, double[] dest) length Check return src.length == dest.length;
|
void | lengthCheck(final byte[] buffer, final byte length) length Check if (buffer.length != length) { throw new IllegalArgumentException("buffer length must be " + length + " bytes"); |