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