public class TripleLongPriorityQueue extends Object implements AutoCloseable
This class is not thread safe and the items are stored in direct memory.
| Constructor and Description |
|---|
TripleLongPriorityQueue()
Create a new priority queue with default initial capacity.
|
TripleLongPriorityQueue(int initialCapacity)
Create a new priority queue with a given initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(long n1,
long n2,
long n3)
Add a tuple of 3 long items to the priority queue.
|
void |
clear()
Clear all items.
|
void |
close()
Close the priority queue and free the memory associated.
|
boolean |
isEmpty()
Returns whether the priority queue is empty.
|
long |
peekN1()
Read the 1st long item in the top tuple in the priority queue.
|
long |
peekN2()
Read the 2nd long item in the top tuple in the priority queue.
|
long |
peekN3()
Read the 3rd long item in the top tuple in the priority queue.
|
void |
pop()
Removes the first item from the queue.
|
int |
size()
Returns the number of tuples in the priority queue.
|
public TripleLongPriorityQueue()
public TripleLongPriorityQueue(int initialCapacity)
initialCapacity - public void close()
close in interface AutoCloseablepublic void add(long n1,
long n2,
long n3)
n1 - n2 - n3 - public long peekN1()
The tuple will not be extracted
public long peekN2()
The tuple will not be extracted
public long peekN3()
The tuple will not be extracted
public void pop()
public boolean isEmpty()
public int size()
public void clear()
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.