Package org.locationtech.jts.util
Class CollectionUtil
java.lang.Object
org.locationtech.jts.util.CollectionUtil
Utilities for processing
Collection
s.- Version:
- 1.7
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
apply
(Collection coll, CollectionUtil.Function func) Executes a function on each item in a Collection but does not accumulate the resultstatic List
select
(Collection collection, CollectionUtil.Function func) Executes aCollectionUtil.Function
on each item in a Collection and collects all the entries for which the result of the function is equal toBoolean
true.static List
transform
(Collection coll, CollectionUtil.Function func) Executes a function on each item in aCollection
and returns the results in a newList
-
Constructor Details
-
CollectionUtil
public CollectionUtil()
-
-
Method Details
-
transform
Executes a function on each item in aCollection
and returns the results in a newList
- Parameters:
coll
- the collection to processfunc
- the Function to execute- Returns:
- a list of the transformed objects
-
apply
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
Executes aCollectionUtil.Function
on each item in a Collection and collects all the entries for which the result of the function is equal toBoolean
true.- Parameters:
collection
- the collection to processfunc
- the Function to execute- Returns:
- a list of objects for which the function was true
-