public class YLongToObjectMap<V>
extends java.lang.Object
| Constructor and Description |
|---|
YLongToObjectMap()
Creates an empty map.
|
YLongToObjectMap(int initialCapacity)
Creates an empty map with preallocated space for entries.
|
| Modifier and Type | Method and 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.
|
public YLongToObjectMap()
public YLongToObjectMap(int initialCapacity)
initialCapacity - initial capacity of the mappublic V put(long key, V value)
key - key of the mappingvalue - value of the mappingnull if there was no given key in the map.public V get(long key)
key - key of the mappingnull if there is no given key in the mappublic boolean containsKey(long key)
key - key to checktrue if map contains mapping with given key, false otherwisepublic V remove(long key)
key - key of the mappingnull if there was no given key in the map.public void clear()
public int size()
public boolean isEmpty()
true if the map is empty, false if set contains one or more elementspublic void forEachEntry(YLongAndObjectProcedure<V> procedure)
procedure - procedure to execute on each entry in the map.java.lang.IllegalArgumentException - if passed procedure is nullpublic void forEachKey(YLongProcedure procedure)
procedure - procedure to execute on each key in the map.java.lang.IllegalArgumentException - if passed procedure is nullCopyright © 2018 SAP SE. All Rights Reserved.