org.entityfs.support.lang
Class ArrayUtil

java.lang.Object
  extended by org.entityfs.support.lang.ArrayUtil

public final class ArrayUtil
extends Object

This class contains static utility methods for working with arrays.

Since:
1.0
Author:
Karl Gustafsson

Method Summary
static
<T> T[]
filterArray(T[] arr, ArrayFilter<T> f)
          Filter and possibly transform the elements in arr and return them in a new array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

filterArray

public static <T> T[] filterArray(T[] arr,
                                  ArrayFilter<T> f)
                       throws NullPointerException
Filter and possibly transform the elements in arr and return them in a new array.

Type Parameters:
T - The type of elements in the array.
Parameters:
arr - The array to filter.
f - The filter to apply. The filter may also transform the array values.
Returns:
The target array, containing transformed elements that passed the filter.
Throws:
NullPointerException - If any of the arguments are null.