T - the type of elements maintained by this Collectionpublic abstract class AbstractObject2LongMap<T> extends java.util.AbstractMap<T,java.lang.Long> implements Object2LongMap<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractObject2LongMap.BasicEntry<T>
A Simple Type Specific Entry class to reduce boxing/unboxing
|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2LongMap.BuilderCache<T>, Object2LongMap.Entry<T>, Object2LongMap.FastEntrySet<T>, Object2LongMap.MapBuilder| Constructor and Description |
|---|
AbstractObject2LongMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToAll(Object2LongMap<T> m)
A Helper method to bulk add primitives together.
|
long |
computeLong(T key,
ObjectLongUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfAbsent(T key,
Object2LongFunction<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfPresent(T key,
ObjectLongUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(long value)
Type Specific method to reduce boxing/unboxing of values
|
Object2LongMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<T,java.lang.Long>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
void |
forEach(ObjectLongConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Long |
get(java.lang.Object key) |
long |
getDefaultReturnValue()
Method to see what the default return value is.
|
java.lang.Long |
getOrDefault(java.lang.Object key,
java.lang.Long defaultValue) |
int |
hashCode() |
ObjectSet<T> |
keySet() |
void |
mergeAllLong(Object2LongMap<T> m,
LongLongUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
long |
mergeLong(T key,
long value,
LongLongUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
java.lang.Long |
put(T key,
java.lang.Long value)
Deprecated.
|
void |
putAll(java.util.Map<? extends T,? extends java.lang.Long> m) |
void |
putAll(Object2LongMap<T> m)
Type Specific function for the bull putting of values
|
void |
putAll(T[] keys,
long[] values,
int offset,
int size)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(T[] keys,
java.lang.Long[] values,
int offset,
int size)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAllIfAbsent(Object2LongMap<T> m)
Type-Specific bulk put method put elements into the map if not present.
|
java.lang.Long |
remove(java.lang.Object key) |
long |
replace(T key,
long value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
long oldValue,
long newValue)
A Type Specific replace method to replace an existing value
|
void |
replaceLongs(Object2LongMap<T> m)
Type-Specific bulk replace method.
|
void |
replaceLongs(ObjectLongUnaryOperator<T> mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
AbstractObject2LongMap<T> |
setDefaultReturnValue(long v)
Method to define the default return value if a requested key isn't present
|
long |
supplyLongIfAbsent(T key,
LongSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
LongCollection |
values() |
addTo, builder, compute, computeIfAbsent, computeIfPresent, containsValue, forEach, getLong, getOrDefault, merge, object2LongEntrySet, put, putAll, putAll, putIfAbsent, putIfAbsent, rem, remOrDefault, remove, remove, replace, replace, replaceAll, subFrom, synchronize, synchronize, unmodifiableapplyAsLongpublic long getDefaultReturnValue()
Object2LongMapgetDefaultReturnValue in interface Object2LongMap<T>public AbstractObject2LongMap<T> setDefaultReturnValue(long v)
Object2LongMapsetDefaultReturnValue in interface Object2LongMap<T>v - value that should be the default return valuepublic Object2LongMap<T> copy()
Object2LongMapcopy in interface Object2LongMap<T>@Deprecated public java.lang.Long put(T key, java.lang.Long value)
put in interface java.util.Map<T,java.lang.Long>put in interface Object2LongMap<T>put in class java.util.AbstractMap<T,java.lang.Long>public void addToAll(Object2LongMap<T> m)
Object2LongMapaddToAll in interface Object2LongMap<T>m - the values that should be added/insertedpublic void putAll(Object2LongMap<T> m)
Object2LongMapputAll in interface Object2LongMap<T>m - the elements that should be insertedpublic void putAll(java.util.Map<? extends T,? extends java.lang.Long> m)
public void putAll(T[] keys, long[] values, int offset, int size)
Object2LongMapputAll in interface Object2LongMap<T>keys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedMap.putAll(Map)public void putAll(T[] keys, java.lang.Long[] values, int offset, int size)
Object2LongMapputAll in interface Object2LongMap<T>keys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedMap.putAll(Map)public void putAllIfAbsent(Object2LongMap<T> m)
Object2LongMapputAllIfAbsent in interface Object2LongMap<T>m - elements that should be added if not present.public boolean containsKey(java.lang.Object key)
public boolean containsValue(long value)
Object2LongMapcontainsValue in interface Object2LongMap<T>value - element that is searched forpublic boolean replace(T key, long oldValue, long newValue)
Object2LongMapreplace in interface Object2LongMap<T>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public long replace(T key, long value)
Object2LongMapreplace in interface Object2LongMap<T>key - the element that should be searched forvalue - the value to replace with.public void replaceLongs(Object2LongMap<T> m)
Object2LongMapreplaceLongs in interface Object2LongMap<T>m - elements that should be replaced.public void replaceLongs(ObjectLongUnaryOperator<T> mappingFunction)
Object2LongMapreplaceLongs in interface Object2LongMap<T>mappingFunction - operation to replace all valuespublic long computeLong(T key, ObjectLongUnaryOperator<T> mappingFunction)
Object2LongMapcomputeLong in interface Object2LongMap<T>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic long computeLongIfAbsent(T key, Object2LongFunction<T> mappingFunction)
Object2LongMapcomputeLongIfAbsent in interface Object2LongMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic long supplyLongIfAbsent(T key, LongSupplier valueProvider)
Object2LongMapsupplyLongIfAbsent in interface Object2LongMap<T>key - the key that should be computedvalueProvider - the value if not presentpublic long computeLongIfPresent(T key, ObjectLongUnaryOperator<T> mappingFunction)
Object2LongMapcomputeLongIfPresent in interface Object2LongMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic long mergeLong(T key, long value, LongLongUnaryOperator mappingFunction)
Object2LongMapmergeLong in interface Object2LongMap<T>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllLong(Object2LongMap<T> m, LongLongUnaryOperator mappingFunction)
Object2LongMapmergeAllLong in interface Object2LongMap<T>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic java.lang.Long get(java.lang.Object key)
get in interface java.util.Map<T,java.lang.Long>get in interface Object2LongMap<T>get in class java.util.AbstractMap<T,java.lang.Long>public java.lang.Long getOrDefault(java.lang.Object key,
java.lang.Long defaultValue)
getOrDefault in interface java.util.Map<T,java.lang.Long>getOrDefault in interface Object2LongMap<T>public java.lang.Long remove(java.lang.Object key)
remove in interface java.util.Map<T,java.lang.Long>remove in interface Object2LongMap<T>remove in class java.util.AbstractMap<T,java.lang.Long>key - the element that should be removedMap.remove(Object)public void forEach(ObjectLongConsumer<T> action)
Object2LongMapforEach in interface Object2LongMap<T>action - processor of the values that are iterator overpublic ObjectSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Long>keySet in interface Object2LongMap<T>keySet in class java.util.AbstractMap<T,java.lang.Long>public LongCollection values()
values in interface java.util.Map<T,java.lang.Long>values in interface Object2LongMap<T>values in class java.util.AbstractMap<T,java.lang.Long>public ObjectSet<java.util.Map.Entry<T,java.lang.Long>> entrySet()
entrySet in interface java.util.Map<T,java.lang.Long>entrySet in interface Object2LongMap<T>entrySet in class java.util.AbstractMap<T,java.lang.Long>public boolean equals(java.lang.Object o)