Class CountingLongPredicate

java.lang.Object
org.apache.commons.collections4.bloomfilter.CountingLongPredicate
All Implemented Interfaces:
LongPredicate

class CountingLongPredicate extends Object implements 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 Details

    • idx

      private int idx
    • ary

      private final long[] ary
    • func

      private final LongBiPredicate func
  • Constructor Details

    • CountingLongPredicate

      CountingLongPredicate(long[] ary, LongBiPredicate func)
      Constructs an instance that will compare the elements in ary with the elements returned by func. function is called as func.test( idxValue, otherValue ). If there are more otherValue values than idxValues then func is called as func.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 to BitMapExtractor.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:
      test in interface LongPredicate