it.unimi.dsi.big.util
Class AbstractPrefixMap
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
it.unimi.dsi.big.util.AbstractPrefixMap
- All Implemented Interfaces:
- PrefixMap<MutableString>, StringMap<MutableString>, Function<CharSequence,Long>, Object2LongFunction<CharSequence>, Size64, Serializable
- Direct Known Subclasses:
- ImmutableExternalPrefixMap, TernaryIntervalSearchTree
public abstract class AbstractPrefixMap
- extends AbstractObject2LongFunction<CharSequence>
- implements PrefixMap<MutableString>, Serializable
An abstract implementation of a prefix map.
This class provides the full services of a PrefixMap
by implementing just
getInterval(CharSequence)
and getTerm(long, MutableString)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rangeMap
protected Object2ObjectFunction<CharSequence,LongInterval> rangeMap
prefixMap
protected AbstractObject2ObjectFunction<LongInterval,MutableString> prefixMap
list
protected ObjectBigList<MutableString> list
AbstractPrefixMap
public AbstractPrefixMap()
getInterval
protected abstract LongInterval getInterval(CharSequence prefix)
- Returns the range of strings having a given prefix.
- Parameters:
prefix
- a prefix.
- Returns:
- the corresponding range of strings as an interval.
getTerm
protected abstract MutableString getTerm(long left,
MutableString string)
- Writes a string specified by index into a
MutableString
.
- Parameters:
left
- the index of a string.string
- a mutable string.
- Returns:
string
.
rangeMap
public Object2ObjectFunction<CharSequence,LongInterval> rangeMap()
- Description copied from interface:
PrefixMap
- Returns a function mapping prefixes to ranges of strings.
- Specified by:
rangeMap
in interface PrefixMap<MutableString>
- Returns:
- a function mapping prefixes to ranges of strings.
prefixMap
public Object2ObjectFunction<LongInterval,MutableString> prefixMap()
- Description copied from interface:
PrefixMap
- Returns a function mapping ranges of strings to common prefixes (optional operation).
- Specified by:
prefixMap
in interface PrefixMap<MutableString>
- Returns:
- a function mapping ranges of strings to common prefixes, or
null
if this
map does not support prefixes.
list
public ObjectBigList<MutableString> list()
- Description copied from interface:
StringMap
- Returns a list view of the domain of this string map (optional operation).
Note that the list view acts as an inverse of the mapping implemented by this map.
- Specified by:
list
in interface StringMap<MutableString>
- Returns:
- a list view of the domain of this string map, or
null
if this map does
not support this operation.