public class LongHeapPriorityQueue extends java.lang.Object implements LongPriorityQueue
| Constructor and Description |
|---|
LongHeapPriorityQueue()
Default Constructor
|
LongHeapPriorityQueue(int size)
Constructor with a Min Capacity
|
LongHeapPriorityQueue(int size,
LongComparator comp)
Constructor with a Min Capacity and custom Sorter
|
LongHeapPriorityQueue(long[] array)
Constructor using a initial array
|
LongHeapPriorityQueue(long[] array,
int size)
Constructor using a initial array
|
LongHeapPriorityQueue(long[] array,
int size,
LongComparator comp)
Constructor using a initial array and a custom sorter
|
LongHeapPriorityQueue(long[] array,
LongComparator comp)
Constructor using a initial array and a custom sorter
|
LongHeapPriorityQueue(LongCollection c)
Constructor using a Collection
|
LongHeapPriorityQueue(LongCollection c,
LongComparator comp)
Constructor using a Collection and a custom sorter
|
LongHeapPriorityQueue(LongComparator comp)
Constructor using custom sorter
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
LongComparator |
comparator() |
long |
dequeueLong()
Method to extract a element from the PriorityQueue
|
void |
enqueueLong(long e)
Method to insert a element into the PriorityQueue
|
LongIterator |
iterator()
Returns an iterator over elements of type
T. |
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
long |
peekLong(int index)
Peeking function to see whats inside the queue.
|
boolean |
removeLastLong(long e)
Removes the last found element in the queue
|
boolean |
removeLong(long e)
Removes the first found element in the queue
|
int |
size() |
java.lang.Long[] |
toArray(java.lang.Long[] input)
A method to drop the contents of the Queue without clearing the queue
|
long[] |
toLongArray(long[] input)
A method to drop the contents of the Queue without clearing the queue
|
static LongHeapPriorityQueue |
wrap(long[] array)
Wrapping method to help serialization
|
static LongHeapPriorityQueue |
wrap(long[] array,
int size)
Wrapping method to help serialization
|
static LongHeapPriorityQueue |
wrap(long[] array,
int size,
LongComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static LongHeapPriorityQueue |
wrap(long[] array,
LongComparator comp)
Wrapping method to help serialization, using a custom sorter
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdequeue, enqueue, first, firstLong, peek, remove, removeLast, toArray, toLongArrayisEmptyforEach, forEach, spliteratorpublic LongHeapPriorityQueue()
public LongHeapPriorityQueue(LongComparator comp)
comp - Comparator to sort the Array. Can be nullpublic LongHeapPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public LongHeapPriorityQueue(int size,
LongComparator comp)
size - the initial capacity of the backing arraycomp - Comparator to sort the Array. Can be nulljava.lang.IllegalStateException - if the initial size is smaller 0public LongHeapPriorityQueue(long[] array)
array - the Array that should be usedpublic LongHeapPriorityQueue(long[] array,
int size)
array - the Array that should be usedsize - the amount of elements found within the arrayjava.lang.NegativeArraySizeException - if size is smaller then 0public LongHeapPriorityQueue(long[] array,
LongComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic LongHeapPriorityQueue(long[] array,
int size,
LongComparator comp)
array - the Array that should be usedsize - the amount of elements found within the arraycomp - Comparator to sort the Array. Can be nulljava.lang.NegativeArraySizeException - if size is smaller then 0public LongHeapPriorityQueue(LongCollection c)
c - the Collection that should be usedpublic LongHeapPriorityQueue(LongCollection c, LongComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static LongHeapPriorityQueue wrap(long[] array)
array - the array that should be usedpublic static LongHeapPriorityQueue wrap(long[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static LongHeapPriorityQueue wrap(long[] array, LongComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static LongHeapPriorityQueue wrap(long[] array, int size, LongComparator comp)
array - the array that should be usedsize - the amount of elements within the arraycomp - Comparator to sort the Array. Can be nullpublic int size()
size in interface ObjectPriorityQueue<java.lang.Long>public void clear()
ObjectPriorityQueueclear in interface ObjectPriorityQueue<java.lang.Long>public LongIterator iterator()
LongIterableT.iterator in interface java.lang.Iterable<java.lang.Long>iterator in interface LongIterablepublic void enqueueLong(long e)
LongPriorityQueueenqueueLong in interface LongPriorityQueuee - the element that should be insertedpublic long dequeueLong()
LongPriorityQueuedequeueLong in interface LongPriorityQueuepublic long peekLong(int index)
LongPriorityQueuepeekLong in interface LongPriorityQueueindex - of the element that is requested to be viewed.public boolean removeLong(long e)
LongPriorityQueueremoveLong in interface LongPriorityQueuee - the element that should be removedpublic boolean removeLastLong(long e)
LongPriorityQueueremoveLastLong in interface LongPriorityQueuee - the element that should be removedpublic void onChanged()
LongPriorityQueueonChanged in interface LongPriorityQueueonChanged in interface ObjectPriorityQueue<java.lang.Long>public LongComparator comparator()
comparator in interface LongPriorityQueuecomparator in interface ObjectPriorityQueue<java.lang.Long>public long[] toLongArray(long[] input)
LongPriorityQueuetoLongArray in interface LongPriorityQueueinput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created arraypublic java.lang.Long[] toArray(java.lang.Long[] input)
ObjectPriorityQueuetoArray in interface LongPriorityQueuetoArray in interface ObjectPriorityQueue<java.lang.Long>input - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array