public class CharArrayPriorityQueue extends AbstractCharPriorityQueue
List.indexOf(Object) search.
It is highly suggested to use HeapPriorityQueue otherwise, unless you know why you need this specific implementation| Constructor and Description |
|---|
CharArrayPriorityQueue()
Default Constructor
|
CharArrayPriorityQueue(char[] array)
Constructor using a initial array
|
CharArrayPriorityQueue(char[] array,
CharComparator comp)
Constructor using a initial array and a custom sorter
|
CharArrayPriorityQueue(char[] array,
int size)
Constructor using a initial array
|
CharArrayPriorityQueue(char[] array,
int size,
CharComparator comp)
Constructor using a initial array and a custom sorter
|
CharArrayPriorityQueue(CharCollection c)
Constructor using a Collection
|
CharArrayPriorityQueue(CharCollection c,
CharComparator comp)
Constructor using a Collection and a custom sorter
|
CharArrayPriorityQueue(CharComparator comp)
Constructor using custom sorter
|
CharArrayPriorityQueue(int size)
Constructor with a Min Capacity
|
CharArrayPriorityQueue(int size,
CharComparator 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
|
CharComparator |
comparator() |
CharArrayPriorityQueue |
copy()
A Function that does a shallow clone of the PriorityQueue itself.
|
int |
count(CharPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
char |
dequeue()
Method to extract a element from the PriorityQueue
|
void |
enqueue(char e)
Method to insert a element into the PriorityQueue
|
char |
findFirst(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
char |
first()
Shows the element that is to be returned next
|
void |
forEach(CharConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectCharConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEachIndexed(IntCharConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
CharIterator |
iterator()
Returns an iterator over elements of type
T. |
boolean |
matchesAll(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
char |
peek(int index)
Peeking function to see whats inside the queue.
|
char |
reduce(char identity,
CharCharUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
char |
reduce(CharCharUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
removeFirst(char e)
Removes the first found element in the queue
|
boolean |
removeLast(char e)
Removes the last found element in the queue
|
int |
size() |
char[] |
toCharArray(char[] input)
A method to drop the contents of the Queue without clearing the queue
|
static CharArrayPriorityQueue |
wrap(char[] array)
Wrapping method to help serialization
|
static CharArrayPriorityQueue |
wrap(char[] array,
CharComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static CharArrayPriorityQueue |
wrap(char[] array,
int size)
Wrapping method to help serialization
|
static CharArrayPriorityQueue |
wrap(char[] array,
int size,
CharComparator comp)
Wrapping method to help serialization, using a custom sorter
|
equals, hashCode, toStringenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, synchronizeQueue, synchronizeQueue, toCharArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pour, pourAsList, pourAsSet, repeat, sorted, spliteratorpublic CharArrayPriorityQueue()
public CharArrayPriorityQueue(CharComparator comp)
comp - Comparator to sort the Array. Can be nullpublic CharArrayPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public CharArrayPriorityQueue(int size,
CharComparator 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 CharArrayPriorityQueue(char[] array)
array - the Array that should be usedpublic CharArrayPriorityQueue(char[] 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 CharArrayPriorityQueue(char[] array,
CharComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic CharArrayPriorityQueue(char[] array,
int size,
CharComparator 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 CharArrayPriorityQueue(CharCollection c)
c - the Collection that should be usedpublic CharArrayPriorityQueue(CharCollection c, CharComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static CharArrayPriorityQueue wrap(char[] array)
array - the array that should be usedpublic static CharArrayPriorityQueue wrap(char[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static CharArrayPriorityQueue wrap(char[] array, CharComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static CharArrayPriorityQueue wrap(char[] array, int size, CharComparator comp)
array - the array that should be usedsize - the amount of elements within the arraycomp - Comparator to sort the Array. Can be nullpublic void enqueue(char e)
CharPriorityQueuee - the element that should be insertedpublic char dequeue()
CharPriorityQueuepublic char first()
CharPriorityQueuepublic char peek(int index)
CharPriorityQueueindex - of the element that is requested to be viewed.public boolean removeFirst(char e)
CharPriorityQueuee - the element that should be removedpublic boolean removeLast(char e)
CharPriorityQueuee - the element that should be removedpublic void onChanged()
CharPriorityQueuepublic int size()
public void clear()
CharPriorityQueuepublic void forEach(CharConsumer action)
CharIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntCharConsumer action)
CharIterableaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectCharConsumer<E> action)
CharIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(CharPredicate filter)
CharIterablefilter - that should be appliedpublic boolean matchesNone(CharPredicate filter)
CharIterablefilter - that should be appliedpublic boolean matchesAll(CharPredicate filter)
CharIterablefilter - that should be appliedpublic char reduce(char identity,
CharCharUnaryOperator operator)
CharIterableidentity - the start valueoperator - the operation that should be appliedpublic char reduce(CharCharUnaryOperator operator)
CharIterableoperator - the operation that should be appliedpublic char findFirst(CharPredicate filter)
CharIterablefilter - that should be appliedpublic int count(CharPredicate filter)
CharIterablefilter - that should be appliedpublic CharIterator iterator()
CharIterableT.public CharArrayPriorityQueue copy()
CharPriorityQueuepublic CharComparator comparator()
public char[] toCharArray(char[] input)
CharPriorityQueueinput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array