类 ConcurrentLongLongPairHashMap
java.lang.Object
org.apache.pulsar.common.util.collections.ConcurrentLongLongPairHashMap
Concurrent hash map where both keys and values are composed of pairs of longs.
(long,long) --> (long,long)
Provides similar methods as a ConcurrentMap<K,V>
but since it's an open hash map with linear probing,
no node allocations are required to store the keys and values, and no boxing is required.
Keys MUST be >= 0.
-
嵌套类概要
嵌套类修饰符和类型类说明static interface
A BiConsumer Long pair.static class
Builder of ConcurrentLongLongPairHashMap.static interface
A Long pair function.static interface
A Long pair predicate.static class
A pair of long values. -
方法概要
修饰符和类型方法说明asMap()
long
capacity()
void
clear()
boolean
containsKey
(long key1, long key2) void
get
(long key1, long key2) boolean
isEmpty()
keys()
boolean
put
(long key1, long key2, long value1, long value2) boolean
putIfAbsent
(long key1, long key2, long value1, long value2) boolean
remove
(long key1, long key2) Remove an existing entry if found.boolean
remove
(long key1, long key2, long value1, long value2) long
size()
values()
-
方法详细资料
-
newBuilder
-
size
public long size() -
capacity
public long capacity() -
isEmpty
public boolean isEmpty() -
get
- 参数:
key1
-key2
-- 返回:
- the value or -1 if the key was not present.
-
containsKey
public boolean containsKey(long key1, long key2) -
put
public boolean put(long key1, long key2, long value1, long value2) -
putIfAbsent
public boolean putIfAbsent(long key1, long key2, long value1, long value2) -
remove
public boolean remove(long key1, long key2) Remove an existing entry if found.- 参数:
key1
-key2
-- 返回:
- the value associated with the key or -1 if key was not present.
-
remove
public boolean remove(long key1, long key2, long value1, long value2) -
clear
public void clear() -
forEach
-
keys
- 返回:
- a new list of all keys (makes a copy).
-
values
-
asMap
-