public abstract class AbstractPrefixMap extends AbstractObject2LongFunction<CharSequence> implements PrefixMap<MutableString>, Serializable
This class provides the full services of a PrefixMap
by implementing just
getInterval(CharSequence)
and getTerm(long, MutableString)
Modifier and Type | Field and Description |
---|---|
protected ObjectBigList<MutableString> |
list |
protected AbstractObject2ObjectFunction<LongInterval,MutableString> |
prefixMap |
protected Object2ObjectFunction<CharSequence,LongInterval> |
rangeMap |
defRetValue
Constructor and Description |
---|
AbstractPrefixMap() |
Modifier and Type | Method and Description |
---|---|
protected abstract LongInterval |
getInterval(CharSequence prefix)
Returns the range of strings having a given prefix.
|
protected abstract MutableString |
getTerm(long left,
MutableString string)
Writes a string specified by index into a
MutableString . |
ObjectBigList<MutableString> |
list()
Returns a list view of the domain of this string map (optional operation).
|
Object2ObjectFunction<LongInterval,MutableString> |
prefixMap()
Returns a function mapping ranges of strings to common prefixes (optional operation).
|
Object2ObjectFunction<CharSequence,LongInterval> |
rangeMap()
Returns a function mapping prefixes to ranges of strings.
|
clear, defaultReturnValue, defaultReturnValue, get, put, put, remove, removeLong
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultReturnValue, defaultReturnValue, getLong, put, removeLong
protected Object2ObjectFunction<CharSequence,LongInterval> rangeMap
protected AbstractObject2ObjectFunction<LongInterval,MutableString> prefixMap
protected ObjectBigList<MutableString> list
protected abstract LongInterval getInterval(CharSequence prefix)
prefix
- a prefix.protected abstract MutableString getTerm(long left, MutableString string)
MutableString
.left
- the index of a string.string
- a mutable string.string
.public Object2ObjectFunction<CharSequence,LongInterval> rangeMap()
PrefixMap
rangeMap
in interface PrefixMap<MutableString>
public Object2ObjectFunction<LongInterval,MutableString> prefixMap()
PrefixMap
prefixMap
in interface PrefixMap<MutableString>
null
if this
map does not support prefixes.public ObjectBigList<MutableString> list()
StringMap
Note that the list view acts as an inverse of the mapping implemented by this map.
list
in interface StringMap<MutableString>
null
if this map does
not support this operation.