Class YLongToObjectMap<V>
- java.lang.Object
-
- de.hybris.platform.util.collections.fast.YLongToObjectMap<V>
-
public class YLongToObjectMap<V> extends java.lang.ObjectMap 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 voidclear()Removes all entries from the map.booleancontainsKey(long key)Checks whether map contains entry with given key.voidforEachEntry(YLongAndObjectProcedure<V> procedure)Allows to execute given procedure for all entries in the map.voidforEachKey(YLongProcedure procedure)Allows to execute given procedure for all keys in the map.Vget(long key)Gets a value mapped by a given key.booleanisEmpty()Checks if the map is empty.Vput(long key, V value)Puts a mapping between given key and given value to the map.Vremove(long key)Removes mapping mapped by given key.intsize()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
nullif 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
nullif 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:
trueif map contains mapping with given key,falseotherwise
-
remove
public V remove(long key)
Removes mapping mapped by given key.- Parameters:
key- key of the mapping- Returns:
- value of removed key, or
nullif 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:
trueif the map is empty,falseif 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
-
-