Modul speiger.src.collections
Klasse LongPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
speiger.src.collections.longs.utils.LongPriorityQueues.SynchronizedPriorityQueue
- Alle implementierten Schnittstellen:
Iterable<Long>,LongIterable,LongPriorityQueue
- Bekannte direkte Unterklassen:
LongPriorityQueues.SynchronizedPriorityDequeue
- Umschließende Klasse:
LongPriorityQueues
public static class LongPriorityQueues.SynchronizedPriorityQueue
extends Object
implements LongPriorityQueue
Wrapper class for synchronization
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclear()clears all elements within the PriorityQueue, this does not resize the backing arraysbooleancontains(long e) Method to find out if a element is part of the queuecopy()A Function that does a shallow clone of the PriorityQueue itself.intcount(LongPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.longdequeue()Method to extract a element from the PriorityQueuevoidenqueue(long e) Method to insert a element into the PriorityQueuevoidenqueueAll(long[] e, int offset, int length) Method to mass insert elements into the PriorityQueuevoidMethod to mass insert elements into the PriorityQueuelongfindFirst(LongPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.<E> voidforEach(E input, ObjectLongConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(LongConsumer action) A Type Specific foreach function that reduces (un)boxingiterator()Returns an iterator over elements of typeT.booleanmatchesAll(LongPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(LongPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(LongPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.voidAllows to notify the Queue to be revalidate its datalongpeek(int index) Peeking function to see whats inside the queue.booleanremoveFirst(long e) Removes the first found element in the queuebooleanremoveLast(long e) Removes the last found element in the queueintsize()long[]toLongArray(long[] 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.longs.collections.LongIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, forEachIndexed, limit, map, peek, pour, pourAsList, pourAsSet, reduce, reduce, repeat, sorted, spliteratorVon Schnittstelle geerbte Methoden speiger.src.collections.longs.queues.LongPriorityQueue
enqueueAll, enqueueAll, first, isEmpty, synchronizeQueue, synchronizeQueue, toLongArray
-
Methodendetails
-
iterator
Beschreibung aus Schnittstelle kopiert:LongIterableReturns an iterator over elements of typeT.- Angegeben von:
iteratorin SchnittstelleIterable<Long>- Angegeben von:
iteratorin SchnittstelleLongIterable- Gibt zurück:
- an Iterator.
-
size
public int size()- Angegeben von:
sizein SchnittstelleLongPriorityQueue- Gibt zurück:
- the amount of elements that are stored in the PriorityQueue
-
clear
public void clear()Beschreibung aus Schnittstelle kopiert:LongPriorityQueueclears all elements within the PriorityQueue, this does not resize the backing arrays- Angegeben von:
clearin SchnittstelleLongPriorityQueue
-
enqueue
public void enqueue(long e) Beschreibung aus Schnittstelle kopiert:LongPriorityQueueMethod to insert a element into the PriorityQueue- Angegeben von:
enqueuein SchnittstelleLongPriorityQueue- Parameter:
e- the element that should be inserted
-
enqueueAll
public void enqueueAll(long[] e, int offset, int length) Beschreibung aus Schnittstelle kopiert:LongPriorityQueueMethod to mass insert elements into the PriorityQueue- Angegeben von:
enqueueAllin SchnittstelleLongPriorityQueue- 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:LongPriorityQueueMethod to mass insert elements into the PriorityQueue- Angegeben von:
enqueueAllin SchnittstelleLongPriorityQueue- Parameter:
c- the elements that should be inserted from the Collection
-
dequeue
public long dequeue()Beschreibung aus Schnittstelle kopiert:LongPriorityQueueMethod to extract a element from the PriorityQueue- Angegeben von:
dequeuein SchnittstelleLongPriorityQueue- Gibt zurück:
- a element from the Queue
-
peek
public long peek(int index) Beschreibung aus Schnittstelle kopiert:LongPriorityQueuePeeking function to see whats inside the queue.- Angegeben von:
peekin SchnittstelleLongPriorityQueue- Parameter:
index- of the element that is requested to be viewed.- Gibt zurück:
- the element that is requested
-
contains
public boolean contains(long e) Beschreibung aus Schnittstelle kopiert:LongPriorityQueueMethod to find out if a element is part of the queue- Angegeben von:
containsin SchnittstelleLongPriorityQueue- Parameter:
e- the element that is searched for- Gibt zurück:
- true if the element is in the queue
-
removeFirst
public boolean removeFirst(long e) Beschreibung aus Schnittstelle kopiert:LongPriorityQueueRemoves the first found element in the queue- Angegeben von:
removeFirstin SchnittstelleLongPriorityQueue- Parameter:
e- the element that should be removed- Gibt zurück:
- if a searched element was removed
-
removeLast
public boolean removeLast(long e) Beschreibung aus Schnittstelle kopiert:LongPriorityQueueRemoves the last found element in the queue- Angegeben von:
removeLastin SchnittstelleLongPriorityQueue- 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:LongPriorityQueueAllows to notify the Queue to be revalidate its data- Angegeben von:
onChangedin SchnittstelleLongPriorityQueue
-
comparator
- Angegeben von:
comparatorin SchnittstelleLongPriorityQueue- Gibt zurück:
- the sorter of the Queue, can be null
-
toLongArray
public long[] toLongArray(long[] input) Beschreibung aus Schnittstelle kopiert:LongPriorityQueueA method to drop the contents of the Queue without clearing the queue- Angegeben von:
toLongArrayin SchnittstelleLongPriorityQueue- 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:LongPriorityQueueA 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 SchnittstelleLongPriorityQueue- Gibt zurück:
- a Shallow Copy of the PriorityQueue
-
forEach
Beschreibung aus Schnittstelle kopiert:LongIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleLongIterable- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEach
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleLongIterable- 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:LongIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
findFirst
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
count
Beschreibung aus Schnittstelle kopiert:LongIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleLongIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-