public interface PrefixMap<S extends CharSequence> extends StringMap<S>
Instances of this class provide the services of a StringMap, but by assuming
the strings are lexicographically ordered, they can provide further information by
exposing a function from string prefixes to intervals and a
function from intervals to string prefixes.
In the first case, given a prefix, we can ask for the range of strings starting
with that prefix, expressed as an Interval. This information is very useful to
satisfy prefix queries (e.g., monitor*) with a brute-force approach.
Optionally, a prefix map may provide the opposite service: given an interval of terms, it
may provide the maximum common prefix. This feature can be checked for by calling
prefixMap().
| Modifier and Type | Method and Description |
|---|---|
Object2ObjectFunction<Interval,S> |
prefixMap()
Returns a function mapping ranges of strings to common prefixes (optional operation).
|
Object2ObjectFunction<CharSequence,Interval> |
rangeMap()
Returns a function mapping prefixes to ranges of strings.
|
defaultReturnValue, defaultReturnValue, getLong, put, removeLongObject2ObjectFunction<CharSequence,Interval> rangeMap()
Object2ObjectFunction<Interval,S> prefixMap()
null if this
map does not support prefixes.