类 RoaringBatchIterator

java.lang.Object
org.bitlap.roaringbitmap.RoaringBatchIterator
所有已实现的接口:
Cloneable, BatchIterator

public final class RoaringBatchIterator extends Object implements BatchIterator
  • 构造器详细资料

    • RoaringBatchIterator

      public RoaringBatchIterator(RoaringArray highLowContainer)
  • 方法详细资料

    • nextBatch

      public int nextBatch(int[] buffer)
      从接口复制的说明: BatchIterator
      Writes the next batch of integers onto the buffer, and returns how many were written. Aims to fill the buffer.
      指定者:
      nextBatch 在接口中 BatchIterator
      参数:
      buffer - - the target to write onto
      返回:
      how many values were written during the call.
    • hasNext

      public boolean hasNext()
      从接口复制的说明: BatchIterator
      Returns true is there are more values to get.
      指定者:
      hasNext 在接口中 BatchIterator
      返回:
      whether the iterator is exhaused or not.
    • clone

      public BatchIterator clone()
      从接口复制的说明: BatchIterator
      Creates a copy of the iterator.
      指定者:
      clone 在接口中 BatchIterator
      覆盖:
      clone 在类中 Object
      返回:
      a clone of the current iterator
    • advanceIfNeeded

      public void advanceIfNeeded(int target)
      从接口复制的说明: BatchIterator
      If needed, advance as long as the next value is smaller than minval The advanceIfNeeded method is used for performance reasons, to skip over unnecessary repeated calls to next. Suppose for example that you wish to compute the intersection between an ordered list of integers (e.g., int[] x = {1,4,5}) and a BatchIterator. You might do it as follows...
      
           int[] buffer = new int[128];
           BatchIterator j = // get an iterator
           int val = // first value from my other data structure
           j.advanceIfNeeded(val);
           while ( j.hasNext() ) {
             int limit = j.nextBatch(buffer);
             for (int i = 0; i < limit; i++) {
               if (buffer[i] == val) {
                 // got it!
                 // do something here
                 val = // get next value?
               }
             }
             j.advanceIfNeeded(val);
           }
           
      The benefit of calling advanceIfNeeded is that each such call can be much faster than repeated calls to "next". The underlying implementation can "skip" over some data.
      指定者:
      advanceIfNeeded 在接口中 BatchIterator
      参数:
      target - threshold