org.roaringbitmap.art.KeyIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of RoaringBitmap Show documentation
Show all versions of RoaringBitmap Show documentation
Roaring bitmaps are compressed bitmaps (also called bitsets) which tend to outperform
conventional compressed bitmaps such as WAH or Concise.
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