public class GrowablePriorityLongPairQueue extends Object
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)
| Modifier and Type | Class and Description |
|---|---|
static class |
GrowablePriorityLongPairQueue.LongPair
Class representing two long values.
|
static interface |
GrowablePriorityLongPairQueue.LongPairConsumer
Represents a function that accepts two long arguments.
|
static interface |
GrowablePriorityLongPairQueue.LongPairPredicate
Predicate to checks for a key-value pair where both of them have long types.
|
| Constructor and Description |
|---|
GrowablePriorityLongPairQueue() |
GrowablePriorityLongPairQueue(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long item1,
long item2) |
int |
capacity() |
void |
clear() |
boolean |
exists(long item1,
long item2) |
void |
forEach(GrowablePriorityLongPairQueue.LongPairConsumer processor) |
boolean |
isEmpty() |
Set<GrowablePriorityLongPairQueue.LongPair> |
items() |
Set<GrowablePriorityLongPairQueue.LongPair> |
items(int numberOfItems) |
GrowablePriorityLongPairQueue.LongPair |
peek() |
GrowablePriorityLongPairQueue.LongPair |
remove()
Removes min element from the heap.
|
boolean |
remove(long item1,
long item2)
It removes all occurrence of given pair from the queue.
|
int |
removeIf(GrowablePriorityLongPairQueue.LongPairPredicate filter)
Removes all of the elements of this collection that satisfy the given predicate.
|
int |
size() |
public GrowablePriorityLongPairQueue()
public GrowablePriorityLongPairQueue(int initialCapacity)
public void add(long item1,
long item2)
public void forEach(GrowablePriorityLongPairQueue.LongPairConsumer processor)
public Set<GrowablePriorityLongPairQueue.LongPair> items()
public Set<GrowablePriorityLongPairQueue.LongPair> items(int numberOfItems)
public int removeIf(GrowablePriorityLongPairQueue.LongPairPredicate filter)
filter - a predicate which returns true for elements to be removedpublic boolean remove(long item1,
long item2)
item1 - item2 - public GrowablePriorityLongPairQueue.LongPair remove()
public GrowablePriorityLongPairQueue.LongPair peek()
public boolean isEmpty()
public int capacity()
public void clear()
public int size()
public boolean exists(long item1,
long item2)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.