Class YLongToObjectMap<V>
- java.lang.Object
-
- de.hybris.platform.util.collections.fast.YLongToObjectMap<V>
-
public class YLongToObjectMap<V> extends java.lang.Object
Map which maps key of primitive type long to value of generic type V.
-
-
Constructor Summary
Constructors Constructor Description YLongToObjectMap()
Creates an empty map.YLongToObjectMap(int initialCapacity)
Creates an empty map with preallocated space for entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all entries from the map.boolean
containsKey(long key)
Checks whether map contains entry with given key.void
forEachEntry(YLongAndObjectProcedure<V> procedure)
Allows to execute given procedure for all entries in the map.void
forEachKey(YLongProcedure procedure)
Allows to execute given procedure for all keys in the map.V
get(long key)
Gets a value mapped by a given key.boolean
isEmpty()
Checks if the map is empty.V
put(long key, V value)
Puts a mapping between given key and given value to the map.V
remove(long key)
Removes mapping mapped by given key.int
size()
Returns number of entries in the map.
-
-
-
Method Detail
-
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 mappingvalue
- 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:
java.lang.IllegalArgumentException
- if passed procedure isnull
-
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:
java.lang.IllegalArgumentException
- if passed procedure isnull
-
-