K - Key typeV - Value typepublic class LowCostIdentityHashMap<K,V extends ValueWithKeyIncluded<K>> extends Object
| Constructor and Description |
|---|
LowCostIdentityHashMap()
Creates a Map with default expected maximum size.
|
LowCostIdentityHashMap(int maxSize)
Creates a Map with the specified maximum size parameter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from this map, leaving it empty.
|
boolean |
containsKey(K key)
Returns whether this map contains the specified key.
|
boolean |
containsValue(V value)
Returns whether this map contains the specified value.
|
V |
get(K key)
Returns the value of the mapping with the specified key.
|
V |
getNextValue()
Special API to return next value - substitute of regular Map.values.iterator().next().
|
boolean |
isEmpty()
Returns whether this Map has no elements.
|
V |
put(V value)
Maps the specified key to the specified value.
|
V |
remove(K key)
Removes the mapping with the specified key from this map.
|
int |
size()
Returns the number of mappings in this Map.
|
public LowCostIdentityHashMap()
public LowCostIdentityHashMap(int maxSize)
maxSize - The estimated maximum number of entries that will be put in
this map.public void clear()
public boolean containsKey(K key)
key - the key to search for.true if this map contains the specified key,
false otherwise.public boolean containsValue(V value)
value - the value to search for.true if this map contains the specified value,
false otherwise.public V get(K key)
key - the key.public V put(V value)
value - the value.null if there was no such mapping.public V remove(K key)
key - the key of the mapping to remove.null if no mapping
for the specified key was found.public boolean isEmpty()
true if this Map has no elements,
false otherwise.size()public int size()
public V getNextValue()
Copyright © 2024 The Apache Software Foundation. All rights reserved.