T - the type of elements maintained by this Collectionpublic class Enum2IntMap<T extends java.lang.Enum<T>> extends AbstractObject2IntMap<T>
AbstractObject2IntMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2IntMap.Entry<T>, Object2IntMap.FastEntrySet<T>| Constructor and Description |
|---|
Enum2IntMap(java.lang.Class<T> keyType)
Default Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
addTo(T key,
int value)
A Helper method to add a primitives together.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
getInt(T key)
A Type Specific get method to reduce boxing/unboxing
|
int |
getOrDefault(T key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<T> |
keySet() |
ObjectSet<Object2IntMap.Entry<T>> |
object2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
int |
put(T key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
putIfAbsent(T key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
int |
remOrDefault(T key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(T key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
IntCollection |
values() |
addToAll, computeInt, computeIntIfAbsent, computeIntIfPresent, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, mergeAllInt, mergeInt, putAll, putAll, putAll, putAllIfAbsent, replace, replace, replaceInts, replaceInts, setDefaultReturnValueclear, containsValue, isEmpty, put, remove, size, toStringcompute, computeIfAbsent, computeIfPresent, containsValue, forEach, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAllapplyAsIntpublic Enum2IntMap(java.lang.Class<T> keyType)
keyType - the type of Enum that should be usedpublic int put(T key, int value)
Object2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public int putIfAbsent(T key, int value)
Object2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public int addTo(T key, int value)
Object2IntMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Integer>containsKey in class AbstractObject2IntMap<T extends java.lang.Enum<T>>public boolean containsValue(int value)
Object2IntMapcontainsValue in interface Object2IntMap<T extends java.lang.Enum<T>>containsValue in class AbstractObject2IntMap<T extends java.lang.Enum<T>>value - element that is searched forpublic int rem(T key)
Object2IntMapkey - the element that should be removedpublic int remOrDefault(T key, int defaultValue)
Object2IntMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(T key, int value)
Object2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public int getInt(T key)
Object2IntMapkey - the key that is searched forpublic int getOrDefault(T key, int defaultValue)
Object2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic ObjectSet<Object2IntMap.Entry<T>> object2IntEntrySet()
Object2IntMappublic ObjectSet<T> keySet()
keySet in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Integer>keySet in interface Object2IntMap<T extends java.lang.Enum<T>>keySet in class AbstractObject2IntMap<T extends java.lang.Enum<T>>public IntCollection values()
values in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Integer>values in interface Object2IntMap<T extends java.lang.Enum<T>>values in class AbstractObject2IntMap<T extends java.lang.Enum<T>>