Interface Trie.ValueConsumer<T>

All Superinterfaces:
Consumer<T>, Trie.ResettingTransitionsReceiver, Trie.TransitionsReceiver, Trie.Walker<T,Void>
Enclosing class:
Trie<T>

public static interface Trie.ValueConsumer<T> extends Consumer<T>, Trie.Walker<T,Void>
Adapter interface providing the methods a Trie.Walker to a Consumer, so that the latter can be used with Trie.process(org.apache.cassandra.db.tries.Trie.Walker<T, R>). This enables calls like trie.forEachEntry(x -> System.out.println(x)); to be mapped directly to a single call to Trie.process(org.apache.cassandra.db.tries.Trie.Walker<T, R>) without extra allocations.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addPathByte(int nextByte)
    Add a single byte to the path.
    default void
    addPathBytes(org.agrona.DirectBuffer buffer, int pos, int count)
    Add the count bytes from position pos in the given buffer.
    default Void
    Called at the completion of the walk.
    default void
    content(T content)
    Called when content is found.
    default void
    resetPathLength(int newDepth)
    Delete all bytes beyond the given length.

    Methods inherited from interface java.util.function.Consumer

    accept, andThen