Package hof.find.assignment
Class FindHof
java.lang.Object
hof.find.assignment.FindHof
public class FindHof
extends java.lang.Object
- Author:
- __STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
Constructors Constructor Description FindHof() -
Method Summary
Modifier and Type Method Description static <E> java.util.Optional<E>find(java.util.function.Predicate<E> predicate, ImmutableList<E> list)Searches the list from front to back until a element is found which passes the predicate.
-
Constructor Details
-
FindHof
public FindHof()
-
-
Method Details
-
find
public static <E> java.util.Optional<E> find(java.util.function.Predicate<E> predicate, ImmutableList<E> list)Searches the list from front to back until a element is found which passes the predicate.- Type Parameters:
E- input and result list item type- Parameters:
predicate- predicate to test each item in the specified list as to whether it should be included or not in the result.list- the specified list of items.- Returns:
- Optional of the item, if found. Otherwise, empty.
- See Also:
- SML find
-