Package org.apache.cassandra.db.tries
Interface Trie.ValueConsumer<T>
- All Superinterfaces:
Consumer<T>,Trie.ResettingTransitionsReceiver,Trie.TransitionsReceiver,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 TypeMethodDescriptiondefault voidaddPathByte(int nextByte) Add a single byte to the path.default voidaddPathBytes(org.agrona.DirectBuffer buffer, int pos, int count) Add the count bytes from position pos in the given buffer.default Voidcomplete()Called at the completion of the walk.default voidCalled when content is found.default voidresetPathLength(int newDepth) Delete all bytes beyond the given length.
-
Method Details
-
content
Description copied from interface:Trie.WalkerCalled when content is found.- Specified by:
contentin interfaceTrie.Walker<T,Void>
-
complete
Description copied from interface:Trie.WalkerCalled at the completion of the walk.- Specified by:
completein interfaceTrie.Walker<T,Void>
-
resetPathLength
default void resetPathLength(int newDepth) Description copied from interface:Trie.ResettingTransitionsReceiverDelete all bytes beyond the given length.- Specified by:
resetPathLengthin interfaceTrie.ResettingTransitionsReceiver
-
addPathByte
default void addPathByte(int nextByte) Description copied from interface:Trie.TransitionsReceiverAdd a single byte to the path.- Specified by:
addPathBytein interfaceTrie.TransitionsReceiver
-
addPathBytes
default void addPathBytes(org.agrona.DirectBuffer buffer, int pos, int count) Description copied from interface:Trie.TransitionsReceiverAdd the count bytes from position pos in the given buffer.- Specified by:
addPathBytesin interfaceTrie.TransitionsReceiver
-