roaring icon indicating copy to clipboard operation
roaring copied to clipboard

Add skippable iterators

Open lemire opened this issue 9 years ago • 4 comments

Java's iterators can skip over values :

https://github.com/RoaringBitmap/RoaringBitmap/blob/master/roaringbitmap/src/main/java/org/roaringbitmap/PeekableIntIterator.java

lemire avatar Mar 19 '16 23:03 lemire

Looks like that link to the java iterator example is broken? Newer link: https://github.com/RoaringBitmap/RoaringBitmap/blob/master/roaringbitmap/src/main/java/org/roaringbitmap/PeekableIntIterator.java

steveyen avatar Jan 23 '19 18:01 steveyen

Updated link.

lemire avatar Jan 23 '19 18:01 lemire

As an application usage example, the bleve full-text library would likely have use for a skip-ahead or advance-able iterator method. It currently has that brute force for-loop that calls HasNext/Next(), not really doing anything meaningful with the interim values...

https://github.com/blevesearch/bleve/blob/master/index/scorch/segment/zap/posting.go#L659

steveyen avatar Jan 23 '19 18:01 steveyen

I have marked this as a priority.

It is not difficult to implement.

lemire avatar Jan 23 '19 18:01 lemire