Function<java.lang.CharSequence,java.lang.Long>
, java.util.function.Function<java.lang.CharSequence,java.lang.Long>
, Object2LongFunction<java.lang.CharSequence>
, java.io.Serializable
, Size64
, java.util.function.ToLongFunction<java.lang.CharSequence>
PrefixMap<S>
AbstractPrefixMap
, ImmutableExternalPrefixMap
, LiterallySignedStringMap
, LongBigListSignedStringMap
, ShiftAddXorSignedStringMap
, StringMaps.PrefixMapWrapper
, StringMaps.StringMapWrapper
, StringMaps.SynchronizedPrefixMap
, StringMaps.SynchronizedStringMap
, TernaryIntervalSearchTree
public interface StringMap<S extends java.lang.CharSequence> extends Object2LongFunction<java.lang.CharSequence>, Size64, java.io.Serializable
String maps represent mappings from strings (actually, any subclass of CharSequence
)
to numbers; they can support reverse
mapping, too. The latter has usually sense only if the map is minimal and perfect (e.g., a bijection of a set
of string with an initial segment of the natural numbers of the same size). String maps are useful for
terms of an MG4J
inverted index, URLs of a WebGraph-compressed
web snapshot, and so on.
Modifier and Type | Field | Description |
---|---|---|
static long |
serialVersionUID |
Modifier and Type | Method | Description |
---|---|---|
ObjectBigList<? extends S> |
list() |
Returns a list view of the domain of this string map (optional operation).
|
default int |
size() |
Deprecated.
Please use
size64() instead. |
default long |
size64() |
Returns the intended number of keys in this function, or -1 if no such number exists.
|
apply, clear, containsKey
applyAsLong, defaultReturnValue, defaultReturnValue, get, getLong, put, put, remove, removeLong
static final long serialVersionUID
ObjectBigList<? extends S> list()
Note that the list view acts as an inverse of the mapping implemented by this map.
null
if this map does
not support this operation.default long size64()
Most function implementations will have some knowledge of the intended number of keys in their domain. In some cases, however, this might not be possible. This default implementation, in particular, returns -1.