java.lang.Object
imagingbook.common.util.ArrayUtils
- Version:
- 2022/11/20
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcountNonNullElements(Object[] arr) Counts the number of non-null elements in the given (non-primitive) array.static <T> Iterator<T> getIterator(T[] array) Returns an iterator for the specified (non-primitive) array.
-
Method Details
-
countNonNullElements
Counts the number of non-null elements in the given (non-primitive) array.- Parameters:
arr- an array of non-primitive type- Returns:
- the number of non-null elements
-
getIterator
Returns an iterator for the specified (non-primitive) array. The resulting iterator does not implementIterator.remove().- Type Parameters:
T- the generic element type- Parameters:
array- a non-primitive array- Returns:
- the associated iterator
-