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

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    SignedFunctionStringMap(it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> function)
    Creates a new string map by wrapping a specified signed function.
    Creates a new string map by creating and wrapping a ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Deprecated.
    long
     
    it.unimi.dsi.fastutil.objects.ObjectBigList<CharSequence>
     
    static void
    main(String[] arg)
     
    int
    Deprecated.
    long
     
     

    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.Function

    apply, clear

    Methods inherited from interface java.util.function.Function

    compose

    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

      protected final it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends CharSequence> 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

      public SignedFunctionStringMap(Iterable<? extends CharSequence> keys) throws IOException
      Creates a new string map by creating and wrapping a ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.
      Parameters:
      keys - the keys used to populate the string map.
      Throws:
      IOException
  • Method Details

    • getLong

      public long getLong(Object o)
      Specified by:
      getLong in interface it.unimi.dsi.fastutil.objects.Object2LongFunction<CharSequence>
    • get

      @Deprecated public Long get(Object o)
      Deprecated.
      Specified by:
      get in interface it.unimi.dsi.fastutil.Function<CharSequence,Long>
      Specified by:
      get in interface it.unimi.dsi.fastutil.objects.Object2LongFunction<CharSequence>
    • containsKey

      public boolean containsKey(Object o)
      Specified by:
      containsKey in interface it.unimi.dsi.fastutil.Function<CharSequence,Long>
    • size

      @Deprecated public int size()
      Deprecated.
      Specified by:
      size in interface it.unimi.dsi.fastutil.Function<CharSequence,Long>
      Specified by:
      size in interface it.unimi.dsi.fastutil.Size64
      Specified by:
      size in interface it.unimi.dsi.big.util.StringMap<CharSequence>
    • size64

      public long size64()
      Specified by:
      size64 in interface it.unimi.dsi.fastutil.Size64
      Specified by:
      size64 in interface it.unimi.dsi.big.util.StringMap<CharSequence>
    • list

      public it.unimi.dsi.fastutil.objects.ObjectBigList<CharSequence> list()
      Specified by:
      list in interface it.unimi.dsi.big.util.StringMap<CharSequence>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • main

      public static void main(String[] arg) throws IOException, com.martiansoftware.jsap.JSAPException, ClassNotFoundException
      Throws:
      IOException
      com.martiansoftware.jsap.JSAPException
      ClassNotFoundException