Package it.unimi.dsi.big.util
Interface StringMap<S extends CharSequence>
- All Superinterfaces:
Function<CharSequence,
,Long> Function<CharSequence,
,Long> Object2LongFunction<CharSequence>
,Serializable
,Size64
,ToLongFunction<CharSequence>
- All Known Subinterfaces:
PrefixMap<S>
- All Known Implementing Classes:
AbstractPrefixMap
,ImmutableExternalPrefixMap
,LiterallySignedStringMap
,LongBigListSignedStringMap
,ShiftAddXorSignedStringMap
,StringMaps.PrefixMapWrapper
,StringMaps.StringMapWrapper
,StringMaps.SynchronizedPrefixMap
,StringMaps.SynchronizedStringMap
,TernaryIntervalSearchTree
public interface StringMap<S extends CharSequence>
extends Object2LongFunction<CharSequence>, Size64, Serializable
A map from strings to longs (and possibly vice versa).
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.
- Since:
- 2.0
- Author:
- Sebastiano Vigna
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionObjectBigList<? extends S>
list()
Returns a list view of the domain of this string map (optional operation).default int
size()
Deprecated.default long
size64()
Returns the intended number of keys in this function, or -1 if no such number exists.Methods inherited from interface it.unimi.dsi.fastutil.Function
apply, clear, containsKey
Methods inherited from interface it.unimi.dsi.fastutil.objects.Object2LongFunction
andThen, andThenByte, andThenChar, andThenDouble, andThenFloat, andThenInt, andThenLong, andThenObject, andThenReference, andThenShort, applyAsLong, composeByte, composeChar, composeDouble, composeFloat, composeInt, composeLong, composeObject, composeReference, composeShort, defaultReturnValue, defaultReturnValue, get, getLong, getOrDefault, getOrDefault, put, put, remove, removeLong
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
-
Method Details
-
list
ObjectBigList<? extends S> list()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.
- Returns:
- a list view of the domain of this string map, or
null
if this map does not support this operation.
-
size64
default long size64()Returns the intended number of keys in this function, or -1 if no such number exists.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.
-
size
Deprecated.Please usesize64()
instead.
-
size64()
instead.