public class IntHeapPriorityQueue extends java.lang.Object implements IntPriorityQueue
| Constructor and Description |
|---|
IntHeapPriorityQueue()
Default Constructor
|
IntHeapPriorityQueue(int size)
Constructor with a Min Capacity
|
IntHeapPriorityQueue(int[] array)
Constructor using a initial array
|
IntHeapPriorityQueue(int[] array,
int size)
Constructor using a initial array
|
IntHeapPriorityQueue(int[] array,
IntComparator comp)
Constructor using a initial array and a custom sorter
|
IntHeapPriorityQueue(int[] array,
int size,
IntComparator comp)
Constructor using a initial array and a custom sorter
|
IntHeapPriorityQueue(IntCollection c)
Constructor using a Collection
|
IntHeapPriorityQueue(IntCollection c,
IntComparator comp)
Constructor using a Collection and a custom sorter
|
IntHeapPriorityQueue(IntComparator comp)
Constructor using custom sorter
|
IntHeapPriorityQueue(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 IntHeapPriorityQueue |
wrap(int[] array)
Wrapping method to help serialization
|
static IntHeapPriorityQueue |
wrap(int[] array,
int size)
Wrapping method to help serialization
|
static IntHeapPriorityQueue |
wrap(int[] array,
IntComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static IntHeapPriorityQueue |
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 IntHeapPriorityQueue()
public IntHeapPriorityQueue(IntComparator comp)
comp - Comparator to sort the Array. Can be nullpublic IntHeapPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public IntHeapPriorityQueue(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 IntHeapPriorityQueue(int[] array)
array - the Array that should be usedpublic IntHeapPriorityQueue(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 IntHeapPriorityQueue(int[] array,
IntComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic IntHeapPriorityQueue(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 IntHeapPriorityQueue(IntCollection c)
c - the Collection that should be usedpublic IntHeapPriorityQueue(IntCollection c, IntComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static IntHeapPriorityQueue wrap(int[] array)
array - the array that should be usedpublic static IntHeapPriorityQueue wrap(int[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static IntHeapPriorityQueue wrap(int[] array, IntComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static IntHeapPriorityQueue 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 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 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 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