Class IdentityMap<K,V>
- java.lang.Object
-
- org.hibernate.internal.util.collections.IdentityMap<K,V>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
static <K,V>
Map.Entry<K,V>[]concurrentEntries(Map<K,V> map)
Return the map entries (as instances ofMap.Entry
in a collection that is safe from concurrent modification).boolean
containsKey(Object key)
boolean
containsValue(Object val)
Map.Entry[]
entryArray()
Set<Map.Entry<K,V>>
entrySet()
void
forEach(BiConsumer<? super K,? super V> action)
Override MapforEach(BiConsumer)
to provide a more efficient implementationV
get(Object key)
static <K,V>
IdentityMap<K,V>instantiateSequenced(int size)
Return a new instance of this class, with iteration order defined as the order in which entries were addedboolean
isEmpty()
Iterator<K>
keyIterator()
Set<K>
keySet()
static <K,V>
voidonEachKey(Map<K,V> map, Consumer<K> consumer)
V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> otherMap)
V
remove(Object key)
int
size()
String
toString()
Collection<V>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
instantiateSequenced
public static <K,V> IdentityMap<K,V> instantiateSequenced(int size)
Return a new instance of this class, with iteration order defined as the order in which entries were added- Parameters:
size
- The size of the map to create- Returns:
- The map
-
concurrentEntries
public static <K,V> Map.Entry<K,V>[] concurrentEntries(Map<K,V> map)
Return the map entries (as instances ofMap.Entry
in a collection that is safe from concurrent modification). ie. we may safely add new instances to the underlyingMap
during iteration of theentries()
.- Parameters:
map
- The map of entries- Returns:
- Collection
-
forEach
public void forEach(BiConsumer<? super K,? super V> action)
Override MapforEach(BiConsumer)
to provide a more efficient implementation
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object val)
- Specified by:
containsValue
in interfaceMap<K,V>
-
entryArray
public Map.Entry[] entryArray()
-
-