Class CountingPredicate<T>
java.lang.Object
org.apache.commons.collections4.bloomfilter.CountingPredicate<T>
- Type Parameters:
T- the type of object being compared.
- All Implemented Interfaces:
Predicate<T>
A predicate that applies the test
func to each member of the ary in
sequence for each call to test(). if the ary is exhausted,
the subsequent calls to test are executed with a null value.
If the calls to test do not exhaust the ary the
processRemaining method can be called to execute the @{code test} with a
null value for each remaining idx value.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCountingPredicate(T[] ary, BiPredicate<T, T> func) Constructs an instance that will compare the elements inarywith the elements returned byfunc. -
Method Summary
Modifier and TypeMethodDescription(package private) booleanCallBiPredicate<T, T>for each remaining unpaired<T>in the input array.boolean
-
Field Details
-
idx
private int idx -
ary
-
func
-
-
Constructor Details
-
CountingPredicate
CountingPredicate(T[] ary, BiPredicate<T, T> func) Constructs an instance that will compare the elements inarywith the elements returned byfunc. function is called asfunc.test( idxValue, otherValue ). If there are moreotherValuevalues thanidxValuesthenfuncis called asfunc.test(null, otherValue).- Parameters:
ary- The array of long values to compare.func- The function to apply to the pairs of long values.
-
-
Method Details
-
processRemaining
boolean processRemaining()CallBiPredicate<T, T>for each remaining unpaired<T>in the input array. This method should be invoked after the predicate has been passed to aExtractor.forEach<T>(BiPredicate<T, T>)to consume any unpaired<T>s. The second argument to the BiPredicate will benull.- Returns:
- true if all calls to the predicate were successful
-
test
-