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