Class CollectionUtil

Hierarchy: Object , CollectionUtil
public class CollectionUtil
Utilities for processing Collections.

Other

  • version: 1.7
public static List transform(Collection coll, Function func)
Executes a function on each item in a Collection and returns the results in a new List
Parameters:
coll - coll the collection to process
func - func the Function to execute
Returns:
a list of the transformed objects
public static void apply(Collection coll, Function func)
Executes a function on each item in a Collection but does not accumulate the result
Parameters:
coll - coll the collection to process
func - func the Function to execute
public static List select(Collection collection, Function func)
Executes a Function on each item in a Collection and collects all the entries for which the result of the function is equal to Boolean true.
Parameters:
collection - collection the collection to process
func - func the Function to execute
Returns:
a list of objects for which the function was true