Class LongMap<V>

  • Type Parameters:
    V - type of the value instance.

    public class LongMap<V>
    extends java.lang.Object
    Simple Map<long, Object>.
    Since:
    4.9
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  LongMap.Node<V>  
    • Constructor Summary

      Constructors 
      Constructor Description
      LongMap()
      Initialize an empty LongMap.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(long key)
      Whether key is present in the map.
      private static <V> LongMap.Node<V>[] createArray​(int sz)  
      V get​(long key)
      Get value for this key
      private void grow()  
      private int index​(long key)  
      private void insert​(LongMap.Node<V> n)  
      V put​(long key, V value)
      Put a new entry into the map
      V remove​(long key)
      Remove an entry from the map
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • size

        private int size
        Number of entries currently in the map.
      • growAt

        private int growAt
        Next size to trigger a grow().
    • Constructor Detail

      • LongMap

        public LongMap()
        Initialize an empty LongMap.
    • Method Detail

      • containsKey

        public boolean containsKey​(long key)
        Whether key is present in the map.
        Parameters:
        key - the key to find.
        Returns:
        true if key is present in the map.
      • get

        public V get​(long key)
        Get value for this key
        Parameters:
        key - the key to find.
        Returns:
        stored value for this key, or null.
      • remove

        public V remove​(long key)
        Remove an entry from the map
        Parameters:
        key - key to remove from the map.
        Returns:
        old value of the key, or null.
      • put

        public V put​(long key,
                     V value)
        Put a new entry into the map
        Parameters:
        key - key to store value under.
        value - new value.
        Returns:
        prior value, or null.
      • grow

        private void grow()
      • index

        private final int index​(long key)
      • createArray

        private static final <V> LongMap.Node<V>[] createArray​(int sz)