@Immutable public final class PrefixMap<P> extends Object
byte[].
To create a PrefixMap, the user adds pairs (Prefix, Value), as in a map. To
query, the user provides a byte[] and the map will allow to iterate over all values which
were added with a prefix of the given byte[].
Currently only supports prefixes of length 5 and 0.
| Modifier and Type | Class and Description |
|---|---|
static class |
PrefixMap.Builder<P>
Builder for PrefixMap.
|
| Modifier and Type | Method and Description |
|---|---|
Iterable<P> |
getAllWithMatchingPrefix(byte[] text)
Provides an iterable which goves over all values which were added with a prefix of the given
text. |
public Iterable<P> getAllWithMatchingPrefix(byte[] text)
text.
The matches with the longest prefixes are returned first. Within a given length, the values are returned in the order they were provided in the builder.