@GwtCompatible(serializable=true, emulated=true) public class EnumCountHashMap<K extends Enum<K>> extends Object
AbstractObjectCountMap
with enum type keys.Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map.
|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key.
|
static <K extends Enum<K>> |
create(Class<K> type)
Creates an empty
EnumCountHashMap instance. |
int |
get(Object key)
Returns the value to which the specified key is mapped, or 0 if this map contains no mapping
for the key.
|
int |
hashCode() |
int |
put(K key,
int value)
Associates the specified value with the specified key in this map.
|
int |
remove(Object key)
Removes the mapping for a key from this map if it is present.
|
public static <K extends Enum<K>> EnumCountHashMap<K> create(Class<K> type)
EnumCountHashMap
instance.public void clear()
public boolean containsKey(@Nullable Object key)
key
- key whose presence in this map is to be testedpublic int get(@Nullable Object key)
key
- the key whose associated value is to be returnedpublic int put(@Nullable K key, int value)
key
- key with which the specified value is to be associatedvalue
- a positive int value to be associated with the specified keypublic int remove(@Nullable Object key)
Returns the value to which this map previously associated the key, or 0 if the map contained no mapping for the key.
key
- key whose mapping is to be removed from the mapCopyright © 2010-2017. All Rights Reserved.