public class LongArrayPriorityQueue extends java.lang.Object implements LongPriorityQueue
List.indexOf(Object) search.
It is highly suggested to use HeapPriorityQueue otherwise, unless you know why you need this specific implementation| Constructor and Description |
|---|
LongArrayPriorityQueue()
Default Constructor
|
LongArrayPriorityQueue(int size)
Constructor with a Min Capacity
|
LongArrayPriorityQueue(int size,
LongComparator comp)
Constructor with a Min Capacity and custom Sorter
|
LongArrayPriorityQueue(long[] array)
Constructor using a initial array
|
LongArrayPriorityQueue(long[] array,
int size)
Constructor using a initial array
|
LongArrayPriorityQueue(long[] array,
int size,
LongComparator comp)
Constructor using a initial array and a custom sorter
|
LongArrayPriorityQueue(long[] array,
LongComparator comp)
Constructor using a initial array and a custom sorter
|
LongArrayPriorityQueue(LongCollection c)
Constructor using a Collection
|
LongArrayPriorityQueue(LongCollection c,
LongComparator comp)
Constructor using a Collection and a custom sorter
|
LongArrayPriorityQueue(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 LongArrayPriorityQueue |
wrap(long[] array)
Wrapping method to help serialization
|
static LongArrayPriorityQueue |
wrap(long[] array,
int size)
Wrapping method to help serialization
|
static LongArrayPriorityQueue |
wrap(long[] array,
int size,
LongComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static LongArrayPriorityQueue |
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 LongArrayPriorityQueue()
public LongArrayPriorityQueue(LongComparator comp)
comp - Comparator to sort the Array. Can be nullpublic LongArrayPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public LongArrayPriorityQueue(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 LongArrayPriorityQueue(long[] array)
array - the Array that should be usedpublic LongArrayPriorityQueue(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 LongArrayPriorityQueue(long[] array,
LongComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic LongArrayPriorityQueue(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 LongArrayPriorityQueue(LongCollection c)
c - the Collection that should be usedpublic LongArrayPriorityQueue(LongCollection c, LongComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static LongArrayPriorityQueue wrap(long[] array)
array - the array that should be usedpublic static LongArrayPriorityQueue wrap(long[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static LongArrayPriorityQueue wrap(long[] array, LongComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static LongArrayPriorityQueue 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 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 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 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