Class CountingPredicate<T>
java.lang.Object
org.kiwiproject.beta.util.function.CountingPredicate<T>
- All Implemented Interfaces:
Predicate<T>
-
Constructor Summary
ConstructorsConstructorDescriptionCountingPredicate(Predicate<T> predicate) Create a new instance that wrapspredicatein order to count the number of true and false results. -
Method Summary
Modifier and TypeMethodDescription@org.checkerframework.checker.index.qual.NonNegative longReturn the number of times this predicate has gotten afalseresult.boolean@org.checkerframework.checker.index.qual.NonNegative longReturn the number of times this predicate has gotten atrueresult.
-
Constructor Details
-
CountingPredicate
Create a new instance that wrapspredicatein order to count the number of true and false results.- Parameters:
predicate- the originalPredicateto wrap
-
-
Method Details
-
test
-
trueCount
public @org.checkerframework.checker.index.qual.NonNegative long trueCount()Return the number of times this predicate has gotten atrueresult.- Returns:
- the total number of true results
-
falseCount
public @org.checkerframework.checker.index.qual.NonNegative long falseCount()Return the number of times this predicate has gotten afalseresult.- Returns:
- the total number of false results
-