All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.roaringbitmap.art.KeyIterator Maven / Gradle / Ivy

Go to download

Roaring bitmaps are compressed bitmaps (also called bitsets) which tend to outperform conventional compressed bitmaps such as WAH or Concise.

There is a newer version: 1.3.0
Show newest version
package org.roaringbitmap.art;

import java.util.Iterator;

public class KeyIterator implements Iterator {

  private LeafNode current;
  private LeafNodeIterator leafNodeIterator;

  public KeyIterator(Art art, Containers containers) {
    leafNodeIterator = new LeafNodeIterator(art, containers);
    current = null;
  }

  @Override
  public boolean hasNext() {
    boolean hasNext = leafNodeIterator.hasNext();
    if (hasNext) {
      current = leafNodeIterator.next();
    }
    return hasNext;
  }

  @Override
  public byte[] next() {
    return current.getKeyBytes();
  }

  public long nextKey() {
    return current.getKey();
  }

  public long currentContainerIdx() {
    return current.getContainerIdx();
  }

  public void remove() {
    leafNodeIterator.remove();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy