Class LongObjHppcOpenHashMap<T>

java.lang.Object
com.almworks.integers.AbstractWritableLongObjMap<T>
com.almworks.integers.wrappers.LongObjHppcOpenHashMap<T>
All Implemented Interfaces:
com.almworks.integers.LongObjIterable<T>, com.almworks.integers.LongObjMap<T>, com.almworks.integers.WritableLongObjMap<T>, Iterable<com.almworks.integers.LongObjIterator<T>>

public class LongObjHppcOpenHashMap<T> extends com.almworks.integers.AbstractWritableLongObjMap<T>
  • Field Details

    • myMap

      protected final com.carrotsearch.hppc.LongObjectOpenHashMap<T> myMap
  • Constructor Details

    • LongObjHppcOpenHashMap

      public LongObjHppcOpenHashMap()
    • LongObjHppcOpenHashMap

      public LongObjHppcOpenHashMap(int initialCapacity)
    • LongObjHppcOpenHashMap

      public LongObjHppcOpenHashMap(int initialCapacity, float loadFactor)
  • Method Details

    • createFrom

      public static <T> LongObjHppcOpenHashMap<T> createFrom(com.almworks.integers.LongIterable keys, Iterable<T> values)
    • createFrom

      public static <T> LongObjHppcOpenHashMap<T> createFrom(long[] keys, T[] values)
    • createForAdd

      public static <T> LongObjHppcOpenHashMap<T> createForAdd(int count, float loadFactor)
      Creates new hashmap with the specified load factor that is garanteed to not invoke resize after adding count elements
      Returns:
      new hashmap with the specified capacity dependent on count and loadFactor
    • createForAdd

      public static <T> LongObjHppcOpenHashMap<T> createForAdd(int count)
      Creates new hashmap with default load factor
      See Also:
    • containsKey

      public boolean containsKey(long key)
    • size

      public int size()
    • iterator

      @NotNull public @NotNull com.almworks.integers.LongObjIterator<T> iterator()
    • keysIterator

      public com.almworks.integers.LongIterator keysIterator()
    • valuesIterator

      public Iterator<T> valuesIterator()
    • values

      public Collection<T> values()
    • get

      public T get(long key)
    • clear

      public void clear()
    • putImpl

      protected T putImpl(long key, T value)
      Specified by:
      putImpl in class com.almworks.integers.AbstractWritableLongObjMap<T>
    • lget

      public T lget()
      Returns the last value saved in a call to containsKey(long).
      See Also:
    • lset

      public T lset(T value)
      Sets the value corresponding to the key saved in the last call to containsKey(long), if and only if the key exists in the map already.
      Returns:
      Returns the previous value stored under the given key or null if there was no mapping for the last used key
      See Also:
    • lslot

      public int lslot()
      Returns:
      Returns the slot of the last key looked up in a call to containsKey(long) if it returned true.
      See Also:
    • removeImpl

      protected T removeImpl(long key)
      Specified by:
      removeImpl in class com.almworks.integers.AbstractWritableLongObjMap<T>
    • remove

      public boolean remove(long key, T value)
      Specified by:
      remove in interface com.almworks.integers.WritableLongObjMap<T>
      Overrides:
      remove in class com.almworks.integers.AbstractWritableLongObjMap<T>