Class YLongToObjectMap<V>
java.lang.Object
de.hybris.platform.util.collections.fast.YLongToObjectMap<V>
Map which maps key of primitive type long to value of generic type V.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty map.YLongToObjectMap(int initialCapacity) Creates an empty map with preallocated space for entries. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()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.get(long key) Gets a value mapped by a given key.booleanisEmpty()Checks if the map is empty.Puts a mapping between given key and given value to the map.remove(long key) Removes mapping mapped by given key.intsize()Returns number of entries in the map.
-
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
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
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
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
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 isnull
-
forEachKey
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 isnull
-