public class ConcurrentCountingMap<T> extends Object implements ConcurrentMap<T,Integer>
| 限定符和类型 | 类和说明 |
|---|---|
class |
ConcurrentCountingMap.Entry |
static class |
ConcurrentCountingMap.LockingMode |
| 构造器和说明 |
|---|
ConcurrentCountingMap() |
ConcurrentCountingMap(int size) |
ConcurrentCountingMap(Map<T,AtomicInteger> map) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
int |
decrement(T key)
Decrements the counter associated with the given value by one
|
Set<Map.Entry<T,Integer>> |
entrySet() |
Integer |
get(Object key) |
Set<T> |
getByValue(int value)
Gets all keys that have the given value.
|
int |
getChangeCounter()
Gets the current state of the change counter.
|
int |
increment(T key)
Increments the counter associated with the given value by one
|
int |
increment(T key,
int delta)
Increments the counter associated with the given value by the given delta
|
boolean |
isEmpty() |
Set<T> |
keySet() |
Integer |
put(T key,
Integer value) |
void |
putAll(Map<? extends T,? extends Integer> m) |
Integer |
putIfAbsent(T key,
Integer value) |
Integer |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
Integer |
replace(T key,
Integer value) |
boolean |
replace(T key,
Integer oldValue,
Integer newValue) |
void |
setLockingMode(ConcurrentCountingMap.LockingMode lockingMode)
Sets how whether and how this class shall perform locking
|
int |
size() |
ConcurrentCountingMap<T> |
snapshot()
Creates a snapshot of this map
|
ConcurrentCountingMap<T> |
snapshot(Collection<T> subset)
Creates a partial snapshot of this map
|
Collection<Integer> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllpublic ConcurrentCountingMap()
public ConcurrentCountingMap(int size)
public ConcurrentCountingMap(Map<T,AtomicInteger> map)
public boolean containsKey(Object key)
containsKey 在接口中 Map<T,Integer>public boolean containsValue(Object value)
containsValue 在接口中 Map<T,Integer>public Integer putIfAbsent(T key, Integer value)
putIfAbsent 在接口中 ConcurrentMap<T,Integer>putIfAbsent 在接口中 Map<T,Integer>public int increment(T key)
key - The key of the value for which to increment the counterpublic int increment(T key, int delta)
key - The key of the value for which to increment the counterdelta - The delta by which to increment the counterpublic int decrement(T key)
key - The key of the value for which to decrement the counterpublic Set<T> getByValue(int value)
value - The expected valuepublic void setLockingMode(ConcurrentCountingMap.LockingMode lockingMode)
lockingMode - The new locking modepublic ConcurrentCountingMap<T> snapshot()
public ConcurrentCountingMap<T> snapshot(Collection<T> subset)
subset - The subset of element for which to create a partial snapshotpublic int getChangeCounter()
Copyright © 2022 Fraunhofer SIT. All rights reserved.