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

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

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 currentContainerIdx() {
    return current.getContainerIdx();
  }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy