
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.
The 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 byte[] peekNext() {
return leafNodeIterator.peekNext().getKeyBytes();
}
public long nextKey() {
return current.getKey();
}
public long currentContainerIdx() {
return current.getContainerIdx();
}
@Override
public void remove() {
leafNodeIterator.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy