public class IntArrayPriorityQueue extends java.lang.Object implements IntPriorityQueue
List.indexOf(Object) search.
It is highly suggested to use HeapPriorityQueue otherwise, unless you know why you need this specific implementation| Constructor and Description |
|---|
IntArrayPriorityQueue()
Default Constructor
|
IntArrayPriorityQueue(int size)
Constructor with a Min Capacity
|
IntArrayPriorityQueue(int[] array)
Constructor using a initial array
|
IntArrayPriorityQueue(int[] array,
int size)
Constructor using a initial array
|
IntArrayPriorityQueue(int[] array,
IntComparator comp)
Constructor using a initial array and a custom sorter
|
IntArrayPriorityQueue(int[] array,
int size,
IntComparator comp)
Constructor using a initial array and a custom sorter
|
IntArrayPriorityQueue(IntCollection c)
Constructor using a Collection
|
IntArrayPriorityQueue(IntCollection c,
IntComparator comp)
Constructor using a Collection and a custom sorter
|
IntArrayPriorityQueue(IntComparator comp)
Constructor using custom sorter
|
IntArrayPriorityQueue(int size,
IntComparator comp)
Constructor with a Min Capacity and custom Sorter
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
IntComparator |
comparator() |
int |
dequeueInt()
Method to extract a element from the PriorityQueue
|
void |
enqueueInt(int e)
Method to insert a element into the PriorityQueue
|
IntIterator |
iterator()
Returns an iterator over elements of type
T. |
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
int |
peekInt(int index)
Peeking function to see whats inside the queue.
|
boolean |
removeInt(int e)
Removes the first found element in the queue
|
boolean |
removeLastInt(int e)
Removes the last found element in the queue
|
int |
size() |
java.lang.Integer[] |
toArray(java.lang.Integer[] input)
A method to drop the contents of the Queue without clearing the queue
|
int[] |
toIntArray(int[] input)
A method to drop the contents of the Queue without clearing the queue
|
static IntArrayPriorityQueue |
wrap(int[] array)
Wrapping method to help serialization
|
static IntArrayPriorityQueue |
wrap(int[] array,
int size)
Wrapping method to help serialization
|
static IntArrayPriorityQueue |
wrap(int[] array,
IntComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static IntArrayPriorityQueue |
wrap(int[] array,
int size,
IntComparator comp)
Wrapping method to help serialization, using a custom sorter
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdequeue, enqueue, first, firstInt, peek, remove, removeLast, toArray, toIntArrayisEmptyforEach, forEach, spliteratorpublic IntArrayPriorityQueue()
public IntArrayPriorityQueue(IntComparator comp)
comp - Comparator to sort the Array. Can be nullpublic IntArrayPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public IntArrayPriorityQueue(int size,
IntComparator 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 IntArrayPriorityQueue(int[] array)
array - the Array that should be usedpublic IntArrayPriorityQueue(int[] 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 IntArrayPriorityQueue(int[] array,
IntComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic IntArrayPriorityQueue(int[] array,
int size,
IntComparator 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 IntArrayPriorityQueue(IntCollection c)
c - the Collection that should be usedpublic IntArrayPriorityQueue(IntCollection c, IntComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static IntArrayPriorityQueue wrap(int[] array)
array - the array that should be usedpublic static IntArrayPriorityQueue wrap(int[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static IntArrayPriorityQueue wrap(int[] array, IntComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static IntArrayPriorityQueue wrap(int[] array, int size, IntComparator comp)
array - the array that should be usedsize - the amount of elements within the arraycomp - Comparator to sort the Array. Can be nullpublic void enqueueInt(int e)
IntPriorityQueueenqueueInt in interface IntPriorityQueuee - the element that should be insertedpublic int dequeueInt()
IntPriorityQueuedequeueInt in interface IntPriorityQueuepublic int peekInt(int index)
IntPriorityQueuepeekInt in interface IntPriorityQueueindex - of the element that is requested to be viewed.public boolean removeInt(int e)
IntPriorityQueueremoveInt in interface IntPriorityQueuee - the element that should be removedpublic boolean removeLastInt(int e)
IntPriorityQueueremoveLastInt in interface IntPriorityQueuee - the element that should be removedpublic void onChanged()
IntPriorityQueueonChanged in interface IntPriorityQueueonChanged in interface ObjectPriorityQueue<java.lang.Integer>public int size()
size in interface ObjectPriorityQueue<java.lang.Integer>public void clear()
ObjectPriorityQueueclear in interface ObjectPriorityQueue<java.lang.Integer>public IntIterator iterator()
IntIterableT.iterator in interface java.lang.Iterable<java.lang.Integer>iterator in interface IntIterablepublic IntComparator comparator()
comparator in interface IntPriorityQueuecomparator in interface ObjectPriorityQueue<java.lang.Integer>public int[] toIntArray(int[] input)
IntPriorityQueuetoIntArray in interface IntPriorityQueueinput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created arraypublic java.lang.Integer[] toArray(java.lang.Integer[] input)
ObjectPriorityQueuetoArray in interface IntPriorityQueuetoArray in interface ObjectPriorityQueue<java.lang.Integer>input - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array