Class SignedFunctionStringMap
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
it.unimi.dsi.sux4j.util.SignedFunctionStringMap
- All Implemented Interfaces:
it.unimi.dsi.big.util.StringMap<CharSequence>, it.unimi.dsi.fastutil.Function<CharSequence, Long>, it.unimi.dsi.fastutil.objects.Object2LongFunction<CharSequence>, it.unimi.dsi.fastutil.Size64, Serializable, Function<CharSequence, Long>, ToLongFunction<CharSequence>
public class SignedFunctionStringMap
extends it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
implements it.unimi.dsi.big.util.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
FieldsModifier and TypeFieldDescriptionprotected final it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> The underlying function.Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defRetValue -
Constructor Summary
ConstructorsConstructorDescriptionSignedFunctionStringMap(it.unimi.dsi.fastutil.objects.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, defaultReturnValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.Function
apply, clearMethods 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
public SignedFunctionStringMap(it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> function) 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:
getLongin interfaceit.unimi.dsi.fastutil.objects.Object2LongFunction<CharSequence>
-
get
Deprecated.- Specified by:
getin interfaceit.unimi.dsi.fastutil.Function<CharSequence, Long>- Specified by:
getin interfaceit.unimi.dsi.fastutil.objects.Object2LongFunction<CharSequence>
-
containsKey
- Specified by:
containsKeyin interfaceit.unimi.dsi.fastutil.Function<CharSequence, Long>
-
size
Deprecated.- Specified by:
sizein interfaceit.unimi.dsi.fastutil.Function<CharSequence, Long>- Specified by:
sizein interfaceit.unimi.dsi.fastutil.Size64- Specified by:
sizein interfaceit.unimi.dsi.big.util.StringMap<CharSequence>
-
size64
public long size64()- Specified by:
size64in interfaceit.unimi.dsi.fastutil.Size64- Specified by:
size64in interfaceit.unimi.dsi.big.util.StringMap<CharSequence>
-
list
- Specified by:
listin interfaceit.unimi.dsi.big.util.StringMap<CharSequence>
-
toString
-
main
public static void main(String[] arg) throws IOException, com.martiansoftware.jsap.JSAPException, ClassNotFoundException - Throws:
IOExceptioncom.martiansoftware.jsap.JSAPExceptionClassNotFoundException
-