T - the keyType of elements maintained by this Collectionpublic static class ObjectPriorityQueues.SynchronizedPriorityQueue<T> extends java.lang.Object implements ObjectPriorityQueue<T>
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
java.util.Comparator<? super T> |
comparator() |
ObjectPriorityQueue<T> |
copy()
A Function that does a shallow clone of the PriorityQueue itself.
|
int |
count(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
T |
dequeue()
Method to extract a element from the PriorityQueue
|
void |
enqueue(T e)
Method to insert a element into the PriorityQueue
|
void |
enqueueAll(java.util.Collection<? extends T> c)
Method to mass insert elements into the PriorityQueue
This method exists to add support for Java Collections to make it more useable
|
void |
enqueueAll(ObjectCollection<T> c)
Method to mass insert elements into the PriorityQueue
|
void |
enqueueAll(T[] e,
int offset,
int length)
Method to mass insert elements into the PriorityQueue
|
T |
findFirst(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
void |
forEach(java.util.function.Consumer<? super T> action) |
<E> void |
forEach(E input,
ObjectObjectConsumer<E,T> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
ObjectIterator<T> |
iterator()
Returns an iterator over elements of type
T. |
boolean |
matchesAll(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(java.util.function.Predicate<T> 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
|
T |
peek(int index)
Peeking function to see whats inside the queue.
|
boolean |
removeFirst(T e)
Removes the first found element in the queue
|
boolean |
removeLast(T e)
Removes the last found element in the queue
|
int |
size() |
<E> E[] |
toArray(E[] input)
A method to drop the contents of the Queue without clearing the queue
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenqueueAll, enqueueAll, first, isEmpty, synchronizeQueue, synchronizeQueue, toArray, toArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEachIndexed, limit, map, peek, pour, pourAsList, pourAsSet, reduce, reduce, repeat, sorted, spliteratorpublic ObjectIterator<T> iterator()
ObjectIterableT.iterator in interface java.lang.Iterable<T>iterator in interface ObjectIterable<T>iterator in interface ObjectPriorityQueue<T>public int size()
size in interface ObjectPriorityQueue<T>public void clear()
ObjectPriorityQueueclear in interface ObjectPriorityQueue<T>public void enqueue(T e)
ObjectPriorityQueueenqueue in interface ObjectPriorityQueue<T>e - the element that should be insertedpublic void enqueueAll(T[] e, int offset, int length)
ObjectPriorityQueueenqueueAll in interface ObjectPriorityQueue<T>e - the elements that should be insertedoffset - the offset where in the array should be startedlength - the amount of elements that should be insertedpublic void enqueueAll(ObjectCollection<T> c)
ObjectPriorityQueueenqueueAll in interface ObjectPriorityQueue<T>c - the elements that should be inserted from the Collectionpublic void enqueueAll(java.util.Collection<? extends T> c)
ObjectPriorityQueueenqueueAll in interface ObjectPriorityQueue<T>c - the elements that should be inserted from the Collectionpublic T dequeue()
ObjectPriorityQueuedequeue in interface ObjectPriorityQueue<T>public T peek(int index)
ObjectPriorityQueuepeek in interface ObjectPriorityQueue<T>index - of the element that is requested to be viewed.public boolean removeFirst(T e)
ObjectPriorityQueueremoveFirst in interface ObjectPriorityQueue<T>e - the element that should be removedpublic boolean removeLast(T e)
ObjectPriorityQueueremoveLast in interface ObjectPriorityQueue<T>e - the element that should be removedpublic void onChanged()
ObjectPriorityQueueonChanged in interface ObjectPriorityQueue<T>public java.util.Comparator<? super T> comparator()
comparator in interface ObjectPriorityQueue<T>public <E> E[] toArray(E[] input)
ObjectPriorityQueuetoArray in interface ObjectPriorityQueue<T>E - the keyType of elements maintained by this Collectioninput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created arraypublic ObjectPriorityQueue<T> copy()
ObjectPriorityQueuecopy in interface ObjectPriorityQueue<T>public void forEach(java.util.function.Consumer<? super T> action)
forEach in interface java.lang.Iterable<T>public <E> void forEach(E input,
ObjectObjectConsumer<E,T> action)
ObjectIterableforEach in interface ObjectIterable<T>E - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(java.util.function.Predicate<T> filter)
ObjectIterablematchesAny in interface ObjectIterable<T>filter - that should be appliedpublic boolean matchesNone(java.util.function.Predicate<T> filter)
ObjectIterablematchesNone in interface ObjectIterable<T>filter - that should be appliedpublic boolean matchesAll(java.util.function.Predicate<T> filter)
ObjectIterablematchesAll in interface ObjectIterable<T>filter - that should be appliedpublic T findFirst(java.util.function.Predicate<T> filter)
ObjectIterablefindFirst in interface ObjectIterable<T>filter - that should be appliedpublic int count(java.util.function.Predicate<T> filter)
ObjectIterablecount in interface ObjectIterable<T>filter - that should be applied