Modul speiger.src.collections
Klasse ObjectPriorityQueues.SynchronizedPriorityQueue<T>
java.lang.Object
speiger.src.collections.objects.utils.ObjectPriorityQueues.SynchronizedPriorityQueue<T>
- Typparameter:
T- the keyType of elements maintained by this Collection
- Alle implementierten Schnittstellen:
Iterable<T>,ObjectIterable<T>,ObjectPriorityQueue<T>
- Bekannte direkte Unterklassen:
ObjectPriorityQueues.SynchronizedPriorityDequeue
- Umschließende Klasse:
ObjectPriorityQueues
public static class ObjectPriorityQueues.SynchronizedPriorityQueue<T>
extends Object
implements ObjectPriorityQueue<T>
Wrapper class for synchronization
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclear()clears all elements within the PriorityQueue, this does not resize the backing arraysComparator<? super T>booleanMethod to find out if a element is part of the queuecopy()A Function that does a shallow clone of the PriorityQueue itself.intHelper function to reduce stream usage that allows to count the valid elements.dequeue()Method to extract a element from the PriorityQueuevoidMethod to insert a element into the PriorityQueuevoidenqueueAll(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 useablevoidMethod to mass insert elements into the PriorityQueuevoidenqueueAll(T[] e, int offset, int length) Method to mass insert elements into the PriorityQueueHelper function to reduce stream usage that allows to filter for the first match.<E> voidforEach(E input, ObjectObjectConsumer<E, T> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voiditerator()Returns an iterator over elements of typeT.booleanmatchesAll(Predicate<T> filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(Predicate<T> filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(Predicate<T> filter) Helper function to reduce stream usage that allows to filter for no matches.voidAllows to notify the Queue to be revalidate its datapeek(int index) Peeking function to see whats inside the queue.booleanremoveFirst(T e) Removes the first found element in the queuebooleanremoveLast(T e) Removes the last found element in the queueintsize()<E> E[]toArray(E[] input) A method to drop the contents of the Queue without clearing the queueVon Klasse geerbte Methoden java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden speiger.src.collections.objects.collections.ObjectIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEachIndexed, limit, map, mapToBoolean, mapToByte, mapToDouble, mapToFloat, mapToInt, mapToLong, mapToShort, peek, pour, pourAsList, pourAsSet, reduce, reduce, repeat, sorted, spliteratorVon Schnittstelle geerbte Methoden speiger.src.collections.objects.queues.ObjectPriorityQueue
enqueueAll, enqueueAll, first, isEmpty, synchronizeQueue, synchronizeQueue, toArray, toArray
-
Methodendetails
-
iterator
Beschreibung aus Schnittstelle kopiert:ObjectIterableReturns an iterator over elements of typeT.- Angegeben von:
iteratorin SchnittstelleIterable<T>- Angegeben von:
iteratorin SchnittstelleObjectIterable<T>- Angegeben von:
iteratorin SchnittstelleObjectPriorityQueue<T>- Gibt zurück:
- draining iterator of the PriorityQueue
-
size
public int size()- Angegeben von:
sizein SchnittstelleObjectPriorityQueue<T>- Gibt zurück:
- the amount of elements that are stored in the PriorityQueue
-
clear
public void clear()Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueclears all elements within the PriorityQueue, this does not resize the backing arrays- Angegeben von:
clearin SchnittstelleObjectPriorityQueue<T>
-
enqueue
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueMethod to insert a element into the PriorityQueue- Angegeben von:
enqueuein SchnittstelleObjectPriorityQueue<T>- Parameter:
e- the element that should be inserted
-
enqueueAll
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueMethod to mass insert elements into the PriorityQueue- Angegeben von:
enqueueAllin SchnittstelleObjectPriorityQueue<T>- Parameter:
e- the elements that should be insertedoffset- the offset where in the array should be startedlength- the amount of elements that should be inserted
-
enqueueAll
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueMethod to mass insert elements into the PriorityQueue- Angegeben von:
enqueueAllin SchnittstelleObjectPriorityQueue<T>- Parameter:
c- the elements that should be inserted from the Collection
-
enqueueAll
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueMethod to mass insert elements into the PriorityQueue This method exists to add support for Java Collections to make it more useable- Angegeben von:
enqueueAllin SchnittstelleObjectPriorityQueue<T>- Parameter:
c- the elements that should be inserted from the Collection
-
dequeue
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueMethod to extract a element from the PriorityQueue- Angegeben von:
dequeuein SchnittstelleObjectPriorityQueue<T>- Gibt zurück:
- a element from the Queue
-
peek
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueuePeeking function to see whats inside the queue.- Angegeben von:
peekin SchnittstelleObjectPriorityQueue<T>- Parameter:
index- of the element that is requested to be viewed.- Gibt zurück:
- the element that is requested
-
contains
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueMethod to find out if a element is part of the queue- Angegeben von:
containsin SchnittstelleObjectPriorityQueue<T>- Parameter:
e- the element that is searched for- Gibt zurück:
- true if the element is in the queue
-
removeFirst
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueRemoves the first found element in the queue- Angegeben von:
removeFirstin SchnittstelleObjectPriorityQueue<T>- Parameter:
e- the element that should be removed- Gibt zurück:
- if a searched element was removed
-
removeLast
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueRemoves the last found element in the queue- Angegeben von:
removeLastin SchnittstelleObjectPriorityQueue<T>- Parameter:
e- the element that should be removed- Gibt zurück:
- if a searched element was removed
-
onChanged
public void onChanged()Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueAllows to notify the Queue to be revalidate its data- Angegeben von:
onChangedin SchnittstelleObjectPriorityQueue<T>
-
comparator
- Angegeben von:
comparatorin SchnittstelleObjectPriorityQueue<T>- Gibt zurück:
- the sorter of the Queue, can be null
-
toArray
public <E> E[] toArray(E[] input) Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueA method to drop the contents of the Queue without clearing the queue- Angegeben von:
toArrayin SchnittstelleObjectPriorityQueue<T>- Typparameter:
E- the keyType of elements maintained by this Collection- Parameter:
input- where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array- Gibt zurück:
- the contents of the queue into a seperate array.
-
copy
Beschreibung aus Schnittstelle kopiert:ObjectPriorityQueueA Function that does a shallow clone of the PriorityQueue itself. This function is more optimized then a copy constructor since the PriorityQueue does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk- Angegeben von:
copyin SchnittstelleObjectPriorityQueue<T>- Gibt zurück:
- a Shallow Copy of the PriorityQueue
-
forEach
-
forEach
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleObjectIterable<T>- Typparameter:
E- the generic type of the Object- Parameter:
input- the object that should be includedaction- The action to be performed for each element
-
matchesAny
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
findFirst
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:ObjectIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleObjectIterable<T>- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-