Class CountingLongPredicate
java.lang.Object
org.apache.commons.collections4.bloomfilter.CountingLongPredicate
- All Implemented Interfaces:
LongPredicate
A long 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 zero value.
If the calls to test do not exhaust the ary the processRemaining method can be called to
execute the @{code test} with a zero value for each remaining idx value.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCountingLongPredicate(long[] ary, LongBiPredicate func) Constructs an instance that will compare the elements inarywith the elements returned byfunc. -
Method Summary
Modifier and TypeMethodDescription(package private) booleanCall the long-long consuming bi-predicate for each remaining unpaired long in the input array.booleantest(long other) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.LongPredicate
and, negate, or
-
Field Details
-
idx
private int idx -
ary
private final long[] ary -
func
-
-
Constructor Details
-
CountingLongPredicate
CountingLongPredicate(long[] ary, LongBiPredicate 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( 0, 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()Call the long-long consuming bi-predicate for each remaining unpaired long in the input array. This method should be invoked after the predicate has been passed toBitMapExtractor.processBitMaps(LongPredicate)to consume any unpaired bitmaps. The second argument to the bi-predicate will be zero.- Returns:
- true if all calls to the predicate were successful
-
test
public boolean test(long other) - Specified by:
testin interfaceLongPredicate
-