Package hof.filter.assignment
Class FilterHof
java.lang.Object
hof.filter.assignment.FilterHof
public class FilterHof
extends java.lang.Object
- Author:
- __STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
Constructors Constructor Description FilterHof() -
Method Summary
Modifier and Type Method Description static <E> ImmutableList<E>filter(java.util.function.Predicate<E> predicate, ImmutableList<E> list)Creates and returns a list whose contents are the filtered result of the specified input's elements which pass the predicate's test.
-
Constructor Details
-
FilterHof
public FilterHof()
-
-
Method Details
-
filter
public static <E> ImmutableList<E> filter(java.util.function.Predicate<E> predicate, ImmutableList<E> list)Creates and returns a list whose contents are the filtered result of the specified input's elements which pass the predicate's test. The order in the input must be preserved in the result.- 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:
- a list consisting of the elements which pass the predicate's test
- See Also:
- SML filter
-