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 TypeMethodDescriptionboolean
isFiltered
(@NonNull Object objectToFilter) Returns aboolean
value when the passedobjectToFilter
must be considered by theCrossSection
iterator.
-
Method Details
-
isFiltered
Returns aboolean
value when the passedobjectToFilter
must be considered by theCrossSection
iterator.- Parameters:
objectToFilter
- The current object in theCrossSection
iteration of the source collection.- Returns:
- true if objectToFilter has the required status, false otherwise.
-