Package org.locationtech.jts.util
Class CollectionUtil
- java.lang.Object
-
- org.locationtech.jts.util.CollectionUtil
-
public class CollectionUtil extends Object
Utilities for processingCollections.- Version:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCollectionUtil.Function
-
Constructor Summary
Constructors Constructor Description CollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapply(Collection coll, CollectionUtil.Function func)Executes a function on each item in a Collection but does not accumulate the resultstatic Listselect(Collection collection, CollectionUtil.Function func)Executes aCollectionUtil.Functionon each item in a Collection and collects all the entries for which the result of the function is equal toBooleantrue.static Listtransform(Collection coll, CollectionUtil.Function func)Executes a function on each item in aCollectionand returns the results in a newList
-
-
-
Method Detail
-
transform
public static List transform(Collection coll, CollectionUtil.Function func)
Executes a function on each item in aCollectionand returns the results in a newList- Parameters:
coll- the collection to processfunc- the Function to execute- Returns:
- a list of the transformed objects
-
apply
public static void apply(Collection coll, CollectionUtil.Function func)
Executes a function on each item in a Collection but does not accumulate the result- Parameters:
coll- the collection to processfunc- the Function to execute
-
select
public static List select(Collection collection, CollectionUtil.Function func)
Executes aCollectionUtil.Functionon each item in a Collection and collects all the entries for which the result of the function is equal toBooleantrue.- Parameters:
collection- the collection to processfunc- the Function to execute- Returns:
- a list of objects for which the function was true
-
-