public class IntHashMap extends Object implements Map
Use just like any java.util.Map, except that the keys must be ints. This is much faster than creating a new Integer for each access.
For non-Map access (faster) use the put(int, Object) method.
This class implements Map for convenience, but this is not the most efficient usage.
Modifier and Type | Class and Description |
---|---|
static class |
IntHashMap.Entry |
Constructor and Description |
---|
IntHashMap() |
IntHashMap(int initialCapacity) |
IntHashMap(int initialCapacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(int key) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set |
entrySet() |
Object |
get(int key) |
Object |
get(Object key) |
boolean |
isEmpty() |
Set |
keySet() |
Object |
put(int key,
Object value) |
Object |
put(Object key,
Object value) |
void |
putAll(Map otherMap) |
protected void |
rehash() |
Object |
remove(int key) |
Object |
remove(Object key) |
int |
size() |
Collection |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public IntHashMap(int initialCapacity, float loadFactor)
public IntHashMap(int initialCapacity)
public IntHashMap()
protected void rehash()
public final boolean containsKey(int key)
public final Object get(int key)
public final Object remove(int key)
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsValue(Object value)
containsValue
in interface Map
public Collection values()
Copyright © 1997–2021 The Apache Software Foundation. All rights reserved.