Class LongHashMap<T>

java.lang.Object
org.greenrobot.essentials.collections.LongHashMap<T>
Type Parameters:
T - The value class to store.
Direct Known Subclasses:
LongHashMap.Synchronized

public class LongHashMap<T> extends Object
An minimalistic hash map optimized for long keys. The default implementation is not thread-safe, but you can get a synchronized variant using one of the static createSynchronized methods.
  • Field Details

    • DEFAULT_CAPACITY

      protected static final int DEFAULT_CAPACITY
      See Also:
    • table

      private LongHashMap.Entry<T>[] table
    • capacity

      private int capacity
    • threshold

      private int threshold
    • size

      private volatile int size
  • Constructor Details

    • LongHashMap

      public LongHashMap()
    • LongHashMap

      public LongHashMap(int capacity)
  • Method Details

    • createSynchronized

      public static <T> LongHashMap<T> createSynchronized()
      Creates a synchronized (thread-safe) LongHashSet.
    • createSynchronized

      public static <T> LongHashMap<T> createSynchronized(int capacity)
      Creates a synchronized (thread-safe) LongHashSet using the given initial capacity.
    • containsKey

      public boolean containsKey(long key)
    • get

      public T get(long key)
    • put

      public T put(long key, T value)
    • remove

      public T remove(long key)
    • keys

      public long[] keys()
      Returns all keys in no particular order.
    • entries

      public LongHashMap.Entry<T>[] entries()
      Returns all entries in no particular order.
    • clear

      public void clear()
    • size

      public int size()
    • setCapacity

      public void setCapacity(int newCapacity)
    • reserveRoom

      public void reserveRoom(int entryCount)
      Target load: 0,6