Class SignedFunctionStringMap

  • All Implemented Interfaces:
    it.unimi.dsi.big.util.StringMap<java.lang.CharSequence>, it.unimi.dsi.fastutil.Function<java.lang.CharSequence,​java.lang.Long>, it.unimi.dsi.fastutil.objects.Object2LongFunction<java.lang.CharSequence>, it.unimi.dsi.fastutil.Size64, java.io.Serializable, java.util.function.Function<java.lang.CharSequence,​java.lang.Long>, java.util.function.ToLongFunction<java.lang.CharSequence>

    public class SignedFunctionStringMap
    extends it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<java.lang.CharSequence>
    implements it.unimi.dsi.big.util.StringMap<java.lang.CharSequence>, java.io.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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends java.lang.CharSequence> function
      The underlying function.
      • Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction

        defRetValue
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.Object o)  
      java.lang.Long get​(java.lang.Object o)
      Deprecated.
      long getLong​(java.lang.Object o)  
      it.unimi.dsi.fastutil.objects.ObjectBigList<java.lang.CharSequence> list()  
      static void main​(java.lang.String[] arg)  
      int size()
      Deprecated.
      long size64()  
      java.lang.String toString()  
      • 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 Detail

      • function

        protected final it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends java.lang.CharSequence> function
        The underlying function.
    • Constructor Detail

      • SignedFunctionStringMap

        public SignedFunctionStringMap​(it.unimi.dsi.fastutil.objects.Object2LongFunction<? extends java.lang.CharSequence> function)
        Creates a new string map by wrapping a specified signed function.
        Parameters:
        function - a signed function.
      • SignedFunctionStringMap

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

      • getLong

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

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

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

        @Deprecated
        public int size()
        Deprecated.
        Specified by:
        size in interface it.unimi.dsi.fastutil.Function<java.lang.CharSequence,​java.lang.Long>
        Specified by:
        size in interface it.unimi.dsi.fastutil.Size64
        Specified by:
        size in interface it.unimi.dsi.big.util.StringMap<java.lang.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<java.lang.CharSequence>
      • list

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

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

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