Class YLongToObjectMap<V>

java.lang.Object
de.hybris.platform.util.collections.fast.YLongToObjectMap<V>

public class YLongToObjectMap<V> extends Object
Map which maps key of primitive type long to value of generic type V.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty map.
    YLongToObjectMap(int initialCapacity)
    Creates an empty map with preallocated space for entries.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all entries from the map.
    boolean
    containsKey(long key)
    Checks whether map contains entry with given key.
    void
    Allows to execute given procedure for all entries in the map.
    void
    Allows to execute given procedure for all keys in the map.
    get(long key)
    Gets a value mapped by a given key.
    boolean
    Checks if the map is empty.
    put(long key, V value)
    Puts a mapping between given key and given value to the map.
    remove(long key)
    Removes mapping mapped by given key.
    int
    Returns number of entries in the map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • YLongToObjectMap

      public YLongToObjectMap()
      Creates an empty map.
    • YLongToObjectMap

      public YLongToObjectMap(int initialCapacity)
      Creates an empty map with preallocated space for entries.
      Parameters:
      initialCapacity - initial capacity of the map
  • Method Details

    • put

      public V put(long key, V value)
      Puts a mapping between given key and given value to the map.
      Parameters:
      key - key of the mapping
      value - value of the mapping
      Returns:
      previous value of the key, or null if there was no given key in the map.
    • get

      public V get(long key)
      Gets a value mapped by a given key.
      Parameters:
      key - key of the mapping
      Returns:
      value associated with given key or null if there is no given key in the map
    • containsKey

      public boolean containsKey(long key)
      Checks whether map contains entry with given key.
      Parameters:
      key - key to check
      Returns:
      true if map contains mapping with given key, false otherwise
    • remove

      public V remove(long key)
      Removes mapping mapped by given key.
      Parameters:
      key - key of the mapping
      Returns:
      value of removed key, or null if there was no given key in the map.
    • clear

      public void clear()
      Removes all entries from the map.
    • size

      public int size()
      Returns number of entries in the map.
      Returns:
      number of entries in the map
    • isEmpty

      public boolean isEmpty()
      Checks if the map is empty.
      Returns:
      true if the map is empty, false if set contains one or more elements
    • forEachEntry

      public void forEachEntry(YLongAndObjectProcedure<V> procedure)
      Allows to execute given procedure for all entries in the map.
      Parameters:
      procedure - procedure to execute on each entry in the map.
      Throws:
      IllegalArgumentException - if passed procedure is null
    • forEachKey

      public void forEachKey(YLongProcedure procedure)
      Allows to execute given procedure for all keys in the map.
      Parameters:
      procedure - procedure to execute on each key in the map.
      Throws:
      IllegalArgumentException - if passed procedure is null