Package net.sf.colossus.util
Class ArrayHelper
java.lang.Object
net.sf.colossus.util.ArrayHelper
A collection of static methods to help with using arrays of the Java language.
This is an addition to
Arrays
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
findFirstMatch
(T[][] input, Predicate<T> predicate) Find the first element in the array that matches the predicate.static <T> T
findFirstMatch
(T[] input, Predicate<T> predicate) Find the first element in the array that matches the predicate.
-
Constructor Details
-
ArrayHelper
public ArrayHelper()
-
-
Method Details
-
findFirstMatch
Find the first element in the array that matches the predicate.- Type Parameters:
T
- The type of element to use.- Parameters:
input
- The array of candidates to match. Not null.predicate
- The match condition. Not null.- Returns:
- The first match or null if there is none.
-
findFirstMatch
Find the first element in the array that matches the predicate. This is a two-dimensional version ofinvalid reference
#findFirstMatch(T[], Predicate)
- Type Parameters:
T
- The type of element to use.- Parameters:
input
- The array of candidates to match. Not null.predicate
- The match condition. Not null.- Returns:
- The first match or null if there is none.
-