类 ConcurrentLongPairSet
java.lang.Object
org.apache.pulsar.common.util.collections.ConcurrentLongPairSet
- 所有已实现的接口:
LongPairSet
Concurrent hash set where values are composed of pairs of longs.
Provides similar methods as a ConcurrentHashSet<V>
but since it's an open hash set with linear probing,
no node allocations are required to store the keys and values, and no boxing is required.
Values MUST be >= 0.
-
嵌套类概要
修饰符和类型类说明static class
Builder of ConcurrentLongPairSet.static interface
Represents a function that accepts an object of theLongPair
type.static class
Class representing two long values.static interface
Represents a function that accepts two long arguments.从接口继承的嵌套类/接口 org.apache.pulsar.common.util.collections.LongPairSet
LongPairSet.LongPairFunction<T>, LongPairSet.LongPairPredicate
-
构造器概要
构造器说明已过时。ConcurrentLongPairSet
(int expectedItems) 已过时。ConcurrentLongPairSet
(int expectedItems, int concurrencyLevel) 已过时。ConcurrentLongPairSet
(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor) -
方法概要
修饰符和类型方法说明boolean
add
(long item1, long item2) Adds composite value of item1 and item2 to set.long
capacity()
Returns capacity of the set.void
clear()
Removes all items from set.boolean
contains
(long item1, long item2) Checks if given (item1,item2) composite value exists into set.void
forEach
(ConcurrentLongPairSet.LongPairConsumer processor) ExecuteConcurrentLongPairSet.LongPairConsumer
processor for each entry in the set.boolean
isEmpty()
Check if set is empty.items()
items
(int numberOfItems) <T> Set<T>
items
(int numberOfItems, LongPairSet.LongPairFunction<T> longPairConverter) boolean
remove
(long item1, long item2) Remove an existing entry if found.int
Removes all of the elements of this collection that satisfy the given predicate.long
size()
Returns size of the set.toString()
-
构造器详细资料
-
ConcurrentLongPairSet
已过时。 -
ConcurrentLongPairSet
已过时。 -
ConcurrentLongPairSet
已过时。 -
ConcurrentLongPairSet
public ConcurrentLongPairSet(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
-
-
方法详细资料
-
newBuilder
-
size
public long size()从接口复制的说明:LongPairSet
Returns size of the set.- 指定者:
size
在接口中LongPairSet
- 返回:
-
capacity
public long capacity()从接口复制的说明:LongPairSet
Returns capacity of the set.- 指定者:
capacity
在接口中LongPairSet
- 返回:
-
isEmpty
public boolean isEmpty()从接口复制的说明:LongPairSet
Check if set is empty.- 指定者:
isEmpty
在接口中LongPairSet
- 返回:
-
contains
public boolean contains(long item1, long item2) 从接口复制的说明:LongPairSet
Checks if given (item1,item2) composite value exists into set.- 指定者:
contains
在接口中LongPairSet
- 返回:
-
add
public boolean add(long item1, long item2) 从接口复制的说明:LongPairSet
Adds composite value of item1 and item2 to set.- 指定者:
add
在接口中LongPairSet
- 返回:
-
remove
public boolean remove(long item1, long item2) Remove an existing entry if found.- 指定者:
remove
在接口中LongPairSet
- 参数:
item1
-- 返回:
- true if removed or false if item was not present
-
clear
public void clear()从接口复制的说明:LongPairSet
Removes all items from set.- 指定者:
clear
在接口中LongPairSet
-
forEach
从接口复制的说明:LongPairSet
ExecuteConcurrentLongPairSet.LongPairConsumer
processor for each entry in the set.- 指定者:
forEach
在接口中LongPairSet
-
removeIf
Removes all of the elements of this collection that satisfy the given predicate.- 指定者:
removeIf
在接口中LongPairSet
- 参数:
filter
- a predicate which returnstrue
for elements to be removed- 返回:
- number of removed values
-
items
- 指定者:
items
在接口中LongPairSet
- 返回:
- a new list of all keys (makes a copy)
-
items
- 指定者:
items
在接口中LongPairSet
- 返回:
- a new list of keys with max provided numberOfItems (makes a copy)
-
items
- 指定者:
items
在接口中LongPairSet
longPairConverter
- converts (long,long) pair toobject - 返回:
- a new list of keys with max provided numberOfItems
-
toString
-