Package it.unimi.dsi.sux4j.util
Class SignedFunctionStringMap
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
it.unimi.dsi.sux4j.util.SignedFunctionStringMap
- All Implemented Interfaces:
StringMap<CharSequence>
,Function<CharSequence,
,Long> Object2LongFunction<CharSequence>
,Size64
,Serializable
,Function<CharSequence,
,Long> ToLongFunction<CharSequence>
public class SignedFunctionStringMap
extends AbstractObject2LongFunction<CharSequence>
implements StringMap<CharSequence>, Serializable
A string map based on a signed function.
This class is a very thin wrapper around a signed function on character sequences. Starting with version 3.1, most succinct function implementations can be signed directly, without the help of a wrapper class. The new signature system is much faster and uses a higher-quality hash.
Nonetheless, since all functions in Sux4J are generic (they can map any object) we need a thin adapter (this class) that exposes a generic function as a string map (e.g., for usage in MG4J).
This adapter does not (of course) implement list()
.
- Since:
- 3.1.1
- Author:
- Sebastiano Vigna
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Object2LongFunction<? extends CharSequence>
The underlying function.Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defRetValue
-
Constructor Summary
ConstructorDescriptionSignedFunctionStringMap
(Object2LongFunction<? extends CharSequence> function) Creates a new string map by wrapping a specified signed function.SignedFunctionStringMap
(Iterable<? extends CharSequence> keys) Creates a new string map by creating and wrapping aZFastTrieDistributorMonotoneMinimalPerfectHashFunction
. -
Method Summary
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defaultReturnValue, defaultReturnValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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, getOrDefault, getOrDefault, put, put, remove, removeLong
-
Field Details
-
function
The underlying function.
-
-
Constructor Details
-
SignedFunctionStringMap
Creates a new string map by wrapping a specified signed function.- Parameters:
function
- a signed function.
-
SignedFunctionStringMap
Creates a new string map by creating and wrapping aZFastTrieDistributorMonotoneMinimalPerfectHashFunction
.- Parameters:
keys
- the keys used to populate the string map.- Throws:
IOException
-
-
Method Details
-
getLong
- Specified by:
getLong
in interfaceObject2LongFunction<CharSequence>
-
get
Deprecated.- Specified by:
get
in interfaceFunction<CharSequence,
Long> - Specified by:
get
in interfaceObject2LongFunction<CharSequence>
-
containsKey
- Specified by:
containsKey
in interfaceFunction<CharSequence,
Long>
-
size
Deprecated.- Specified by:
size
in interfaceFunction<CharSequence,
Long> - Specified by:
size
in interfaceSize64
- Specified by:
size
in interfaceStringMap<CharSequence>
-
size64
public long size64()- Specified by:
size64
in interfaceSize64
- Specified by:
size64
in interfaceStringMap<CharSequence>
-
list
- Specified by:
list
in interfaceStringMap<CharSequence>
-
toString
-
main
-