Package microsim.collection
Class Aggregate
java.lang.Object
microsim.collection.Aggregate
A utility class for aggregation tools.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidapplyToFilter(@Nullable Iterable<T> collection, @Nullable org.apache.commons.collections4.Predicate<T> predicate, @NonNull org.apache.commons.collections4.Closure<T> closure) This method filters out certain objects from the provided collection according to the predicate and applies a function to them.
-
Constructor Details
-
Aggregate
public Aggregate()
-
-
Method Details
-
applyToFilter
public static <T> void applyToFilter(@Nullable @Nullable Iterable<T> collection, @Nullable @Nullable org.apache.commons.collections4.Predicate<T> predicate, @NonNull @NonNull org.apache.commons.collections4.Closure<T> closure) This method filters out certain objects from the provided collection according to the predicate and applies a function to them.- Type Parameters:
T- A generic type that usually represent agents.- Parameters:
collection- A collection of objects, can benull.predicate- A logical predicate to filter thecollection, can benull.closure- A function to be applied to all filtered objects.- Throws:
NullPointerException- whenclosureisnull.
-