public class SignedFunctionStringMap extends AbstractObject2LongFunction<CharSequence> implements StringMap<CharSequence>, Serializable
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 such as ShiftAddXorSignedStringMap.
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().
| Modifier and Type | Field and Description |
|---|---|
protected Object2LongFunction<? extends CharSequence> |
function
The underlying function.
|
defRetValue| Constructor and Description |
|---|
SignedFunctionStringMap(Iterable<? extends CharSequence> keys)
Creates a new string map by creating and wrapping a
ZFastTrieDistributorMonotoneMinimalPerfectHashFunction. |
SignedFunctionStringMap(Object2LongFunction<? extends CharSequence> function)
Creates a new string map by wrapping a specified signed function.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(Object o) |
Long |
get(Object o) |
long |
getLong(Object o) |
ObjectBigList<CharSequence> |
list() |
static void |
main(String[] arg) |
int |
size()
Deprecated.
|
long |
size64() |
String |
toString() |
clear, defaultReturnValue, defaultReturnValue, put, put, remove, removeLongclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultReturnValue, defaultReturnValue, put, removeLongprotected final Object2LongFunction<? extends CharSequence> function
public SignedFunctionStringMap(Object2LongFunction<? extends CharSequence> function)
function - a signed function.public SignedFunctionStringMap(Iterable<? extends CharSequence> keys) throws IOException
ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.keys - the keys used to populate the string map.IOExceptionpublic long getLong(Object o)
getLong in interface Object2LongFunction<CharSequence>public Long get(Object o)
get in interface Function<CharSequence,Long>get in class AbstractObject2LongFunction<CharSequence>public boolean containsKey(Object o)
containsKey in interface Function<CharSequence,Long>@Deprecated public int size()
public ObjectBigList<CharSequence> list()
list in interface StringMap<CharSequence>public static void main(String[] arg) throws IOException, JSAPException, ClassNotFoundException