Java Utililty Methods Array Length Get

List of utility methods to do Array Length Get

Description

The list of methods to do Array Length Get are organized into topic(s).

Method

intlength(Object[] array)
length
if (array == null)
    return 0;
return array.length;
intlength(Object[] array)
Null-safe operation to determine an array's length.
return array != null ? array.length : 0;
intlength(Object[] array)
length
if (isEmpty(array)) {
    return 0;
return array.length;
intlength(Object[] buf)
length
return buf.length;
intlength(String[] arr)
length
if (arr == null || arr.length == 0)
    return 0;
int sum = 0;
for (String s : arr)
    sum += length(s);
return sum;
intlength(T[] a)
length
return a == null ? 0 : a.length;
floatlength3(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;
...
booleanlengthCheck(double[] src, double[] dest)
length Check
return src.length == dest.length;
voidlengthCheck(final byte[] buffer, final byte length)
length Check
if (buffer.length != length) {
    throw new IllegalArgumentException("buffer length must be " + length + " bytes");