类 GrowablePriorityLongPairQueue
java.lang.Object
org.apache.pulsar.common.util.collections.GrowablePriorityLongPairQueue
An unbounded priority queue based on a min heap where values are composed of pairs of longs.
When the capacity is reached, data will be moved to a bigger array.
It also act as a set and doesn't store duplicate values if #allowedDuplicate flag is passed false
(long,long)
-
嵌套类概要
嵌套类修饰符和类型类说明static classClass representing two long values.static interfaceRepresents a function that accepts two long arguments.static interfacePredicate to checks for a key-value pair where both of them have long types. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidadd(long item1, long item2) intcapacity()voidclear()booleanexists(long item1, long item2) voidbooleanisEmpty()items()items(int numberOfItems) peek()remove()Removes min element from the heap.booleanremove(long item1, long item2) It removes all occurrence of given pair from the queue.intRemoves all of the elements of this collection that satisfy the given predicate.intsize()
-
构造器详细资料
-
GrowablePriorityLongPairQueue
public GrowablePriorityLongPairQueue() -
GrowablePriorityLongPairQueue
public GrowablePriorityLongPairQueue(int initialCapacity)
-
-
方法详细资料
-
add
public void add(long item1, long item2) -
forEach
-
items
- 返回:
- a new list of all keys (makes a copy)
-
items
- 返回:
- a new list of keys with max provided numberOfItems (makes a copy)
-
removeIf
Removes all of the elements of this collection that satisfy the given predicate.- 参数:
filter- a predicate which returnstruefor elements to be removed- 返回:
- number of removed values
-
remove
public boolean remove(long item1, long item2) It removes all occurrence of given pair from the queue.- 参数:
item1-item2-- 返回:
-
remove
Removes min element from the heap.- 返回:
-
peek
-
isEmpty
public boolean isEmpty() -
capacity
public int capacity() -
clear
public void clear() -
size
public int size() -
exists
public boolean exists(long item1, long item2)
-