Package microsim.statistics
Interface CollectionFilter
public interface CollectionFilter
A collection filter is used by the
CrossSection class to filter elements of the source collection.
Imagine to have a list of agents of the class Agent, which contains a boolean
variable isFemale and an int variable age.
In order to obtain the list of ages of the
males in the collection, the user can crate a class implementing CollectionFilter.
During the cross section iteration of the list, every object is passed to the
isFiltered(Object) method and the corresponding value is read only when the filter returns
true.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisFiltered(@NonNull Object objectToFilter) Returns abooleanvalue when the passedobjectToFiltermust be considered by theCrossSectioniterator.
-
Method Details
-
isFiltered
Returns abooleanvalue when the passedobjectToFiltermust be considered by theCrossSectioniterator.- Parameters:
objectToFilter- The current object in theCrossSectioniteration of the source collection.- Returns:
- true if objectToFilter has the required status, false otherwise.
-