Package org.apache.cassandra.db.tries
Interface Trie.ValueConsumer<T>
-
- All Superinterfaces:
java.util.function.Consumer<T>
,Trie.ResettingTransitionsReceiver
,Trie.TransitionsReceiver
,Trie.Walker<T,java.lang.Void>
public static interface Trie.ValueConsumer<T> extends java.util.function.Consumer<T>, Trie.Walker<T,java.lang.Void>
Adapter interface providing the methods aTrie.Walker
to aConsumer
, so that the latter can be used withTrie.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 toTrie.process(org.apache.cassandra.db.tries.Trie.Walker<T, R>)
without extra allocations.
-
-
Method Summary
All Methods Instance Methods Default Methods 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 java.lang.Void
complete()
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.
-
-
-
Method Detail
-
content
default void content(T content)
Description copied from interface:Trie.Walker
Called when content is found.- Specified by:
content
in interfaceTrie.Walker<T,java.lang.Void>
-
complete
default java.lang.Void complete()
Description copied from interface:Trie.Walker
Called at the completion of the walk.- Specified by:
complete
in interfaceTrie.Walker<T,java.lang.Void>
-
resetPathLength
default void resetPathLength(int newDepth)
Description copied from interface:Trie.ResettingTransitionsReceiver
Delete all bytes beyond the given length.- Specified by:
resetPathLength
in interfaceTrie.ResettingTransitionsReceiver
-
addPathByte
default void addPathByte(int nextByte)
Description copied from interface:Trie.TransitionsReceiver
Add a single byte to the path.- Specified by:
addPathByte
in interfaceTrie.TransitionsReceiver
-
addPathBytes
default void addPathBytes(org.agrona.DirectBuffer buffer, int pos, int count)
Description copied from interface:Trie.TransitionsReceiver
Add the count bytes from position pos in the given buffer.- Specified by:
addPathBytes
in interfaceTrie.TransitionsReceiver
-
-