com.hazelcast.client.impl.protocol.util
Modifier and Type | Class and Description |
---|---|
class |
Int2ObjectHashMap.EntryIterator<V> |
class |
Int2ObjectHashMap.KeyIterator |
class |
Int2ObjectHashMap.KeySet |
static interface |
Int2ObjectHashMap.Supplier<T> |
class |
Int2ObjectHashMap.ValueIterator<T> |
Constructor and Description |
---|
Int2ObjectHashMap() |
Int2ObjectHashMap(int initialCapacity,
double loadFactor)
Construct a new map allowing a configuration for initial capacity and load factor.
|
Modifier and Type | Method and Description |
---|---|
int |
capacity()
Get the total capacity for the map to which the load factor with be a fraction of.
|
void |
clear() |
void |
compact()
Compact the
Map backing arrays by rehashing with a capacity just larger than current size
and giving consideration to the load factor. |
boolean |
containsKey(int key)
Overloaded version of
Map.containsKey(Object) that takes a primitive int key. |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<Integer,V>> |
entrySet() |
V |
get(int key)
Overloaded version of
Map.get(Object) that takes a primitive int key. |
V |
get(Object key) |
V |
getOrDefault(int key,
Int2ObjectHashMap.Supplier<V> supplier)
Get a value for a given key, or if it does ot exist then default the value via a
Int2ObjectHashMap.Supplier
and put it in the map. |
boolean |
isEmpty() |
Int2ObjectHashMap.KeySet |
keySet() |
double |
loadFactor()
Get the load factor beyond which the map will increase size.
|
V |
put(Integer key,
V value) |
V |
put(int key,
V value)
Overloaded version of
Map.put(Object, Object) that takes a primitive int key. |
void |
putAll(Map<? extends Integer,? extends V> map) |
V |
remove(int key)
Overloaded version of
Map.remove(Object) that takes a primitive int key. |
V |
remove(Object key) |
int |
resizeThreshold()
Get the actual threshold which when reached the map resize.
|
int |
size() |
String |
toString() |
Collection<V> |
values() |
public Int2ObjectHashMap()
public Int2ObjectHashMap(int initialCapacity, double loadFactor)
initialCapacity
- for the backing arrayloadFactor
- limit for resizing on putspublic double loadFactor()
public int capacity()
public int resizeThreshold()
public boolean containsKey(Object key)
containsKey
in interface Map<Integer,V>
public boolean containsKey(int key)
Map.containsKey(Object)
that takes a primitive int key.key
- for indexing the Map
public boolean containsValue(Object value)
containsValue
in interface Map<Integer,V>
public V get(int key)
Map.get(Object)
that takes a primitive int key.key
- for indexing the Map
public V getOrDefault(int key, Int2ObjectHashMap.Supplier<V> supplier)
Int2ObjectHashMap.Supplier
and put it in the map.key
- to search on.supplier
- to provide a default if the get returns null.public V put(int key, V value)
Map.put(Object, Object)
that takes a primitive int key.public V remove(int key)
Map.remove(Object)
that takes a primitive int key.key
- for indexing the Map
public void compact()
Map
backing arrays by rehashing with a capacity just larger than current size
and giving consideration to the load factor.public Int2ObjectHashMap.KeySet keySet()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.