Class KeyPredicateKvIterator<K extends Comparable<K>,V>

java.lang.Object
com.usatiuk.objects.iterators.ReversibleKvIterator<K,V>
com.usatiuk.objects.iterators.KeyPredicateKvIterator<K,V>
Type Parameters:
K - the type of the keys
V - the type of the values
All Implemented Interfaces:
CloseableKvIterator<K,V>, AutoCloseable, Iterator<org.apache.commons.lang3.tuple.Pair<K,V>>

public class KeyPredicateKvIterator<K extends Comparable<K>,V> extends ReversibleKvIterator<K,V>
A key-value iterator that filters keys based on a predicate.
  • Constructor Details

    • KeyPredicateKvIterator

      public KeyPredicateKvIterator(CloseableKvIterator<K,V> backing, IteratorStart start, K startKey, Function<K,Boolean> filter)
      Constructs a KeyPredicateKvIterator with the specified backing iterator, start position, and filter.
      Parameters:
      backing - the backing iterator
      start - the starting position relative to the startKey
      startKey - the starting key
      filter - the filter function to apply to keys. Only keys for which this function returns true will be included in the iteration.
  • Method Details