Class ShiftAddXorSignedStringMap
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
it.unimi.dsi.util.ShiftAddXorSignedStringMap
- All Implemented Interfaces:
it.unimi.dsi.fastutil.Function<CharSequence, Long>, it.unimi.dsi.fastutil.objects.Object2LongFunction<CharSequence>, StringMap<CharSequence>, Serializable, Function<CharSequence, Long>, ToLongFunction<CharSequence>
@Deprecated
public class ShiftAddXorSignedStringMap
extends it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
implements StringMap<CharSequence>, Serializable
Deprecated.
There are much better and faster hash functions.
A string map based on a function signed using Shift-Add-Xor hashes.
A minimal perfect hash function maps a set of string to an initial segment of the natural
numbers, but will actually map any string to that segment. By signing
each output value with a hash of the string, we get a dictionary-like functionality with a rate
error that can be balanced with space occupancy (signatures can go from 1 to Long.SIZE bits).
For the kind of hash we use, see “Performance in practice of string hashing functions”, by M.V. Ramakrishna and Justin Zobel, Proc. of the Fifth International Conference on Database Systems for Advanced Applications, 1997, pages 215−223.
- Since:
- 1.1.2
- Author:
- Sebastiano Vigna
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> Deprecated.The underlying map.protected final longDeprecated.The mask to get onlywidthnonzero bits.protected final intDeprecated.The left shift to get onlywidthnonzero bits.protected final it.unimi.dsi.fastutil.longs.LongBigListDeprecated.Signatures.protected final intDeprecated.The width in bits of each signature.Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defRetValue -
Constructor Summary
ConstructorsConstructorDescriptionShiftAddXorSignedStringMap(Iterator<? extends CharSequence> iterator, it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> map) Deprecated.Creates a new shift-add-xor signed string map using a given hash map and 32-bit signatures.ShiftAddXorSignedStringMap(Iterator<? extends CharSequence> iterator, it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> map, int signatureWidth) Deprecated.Creates a new shift-add-xor signed string map using a given hash map. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Deprecated.longDeprecated.it.unimi.dsi.fastutil.objects.ObjectList<CharSequence> list()Deprecated.Returns a list view of the domain of this string map (optional operation).static voidDeprecated.intsize()Deprecated.Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defaultReturnValue, defaultReturnValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
Deprecated.The underlying map. -
signatures
protected final it.unimi.dsi.fastutil.longs.LongBigList signaturesDeprecated.Signatures. -
width
protected final int widthDeprecated.The width in bits of each signature. -
shift
-
mask
-
-
Constructor Details
-
ShiftAddXorSignedStringMap
public ShiftAddXorSignedStringMap(Iterator<? extends CharSequence> iterator, it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> map) Deprecated.Creates a new shift-add-xor signed string map using a given hash map and 32-bit signatures.- Parameters:
iterator- an iterator enumerating a set of strings.map- a minimal perfect hash for the strings enumerated byiterator; it must supportsize()and have default return value -1.
-
ShiftAddXorSignedStringMap
public ShiftAddXorSignedStringMap(Iterator<? extends CharSequence> iterator, it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> map, int signatureWidth) Deprecated.Creates a new shift-add-xor signed string map using a given hash map.- Parameters:
iterator- an iterator enumerating a set of strings.map- a minimal perfect hash for the strings enumerated byiterator; it must supportsize()and have default return value -1.signatureWidth- the width, in bits, of the signature of each string.
-
-
Method Details
-
getLong
Deprecated.- 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
Deprecated.- Specified by:
containsKeyin interfaceit.unimi.dsi.fastutil.Function<CharSequence, Long>
-
size
public int size()Deprecated.- Specified by:
sizein interfaceit.unimi.dsi.fastutil.Function<CharSequence, Long>
-
list
Deprecated.Description copied from interface:StringMapReturns 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:
listin interfaceStringMap<CharSequence>- Returns:
- a list view of the domain of this string map, or
nullif this map does not support this operation.
-
main
public static void main(String[] arg) throws NoSuchMethodException, IOException, com.martiansoftware.jsap.JSAPException, ClassNotFoundException Deprecated.- Throws:
NoSuchMethodExceptionIOExceptioncom.martiansoftware.jsap.JSAPExceptionClassNotFoundException
-