Modul speiger.src.collections
Schnittstelle DoublePriorityQueue
- Alle Superschnittstellen:
DoubleIterable,Iterable<Double>
- Alle bekannten Unterschnittstellen:
DoublePriorityDequeue
- Alle bekannten Implementierungsklassen:
AbstractDoublePriorityQueue,DoubleArrayFIFOQueue,DoubleArrayPriorityQueue,DoubleHeapPriorityQueue,DoubleLinkedList,DoublePriorityQueues.SynchronizedPriorityDequeue,DoublePriorityQueues.SynchronizedPriorityQueue
A Simple PriorityQueue (or Queue) interface that provides with the nessesary functions to interact with it, without cluttering with the Collection interface.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclear()clears all elements within the PriorityQueue, this does not resize the backing arraysbooleancontains(double e) Method to find out if a element is part of the queuecopy()A Function that does a shallow clone of the PriorityQueue itself.doubledequeue()Method to extract a element from the PriorityQueuevoidenqueue(double e) Method to insert a element into the PriorityQueuedefault voidenqueueAll(double... e) Method to mass insert elements into the PriorityQueuedefault voidenqueueAll(double[] e, int length) Method to mass insert elements into the PriorityQueuedefault voidenqueueAll(double[] e, int offset, int length) Method to mass insert elements into the PriorityQueuedefault voidMethod to mass insert elements into the PriorityQueuedefault doublefirst()Shows the element that is to be returned nextdefault booleanisEmpty()voidAllows to notify the Queue to be revalidate its datadoublepeek(int index) Peeking function to see whats inside the queue.booleanremoveFirst(double e) Removes the first found element in the queuebooleanremoveLast(double e) Removes the last found element in the queueintsize()default DoublePriorityQueueCreates a Wrapped PriorityQueue that is Synchronizeddefault DoublePriorityQueuesynchronizeQueue(Object mutex) Creates a Wrapped PriorityQueue that is Synchronizeddefault double[]A method to drop the contents of the Queue without clearing the queuedouble[]toDoubleArray(double[] input) A method to drop the contents of the Queue without clearing the queueVon Schnittstelle geerbte Methoden speiger.src.collections.doubles.collections.DoubleIterable
arrayflatMap, asAsync, count, distinct, filter, findFirst, flatMap, forEach, forEach, forEach, forEachIndexed, iterator, limit, map, matchesAll, matchesAny, matchesNone, peek, pour, pourAsList, pourAsSet, reduce, reduce, repeat, sorted, spliterator
-
Methodendetails
-
isEmpty
default boolean isEmpty()- Gibt zurück:
- true if the PriorityQueue is empty
-
size
int size()- Gibt zurück:
- the amount of elements that are stored in the PriorityQueue
-
clear
void clear()clears all elements within the PriorityQueue, this does not resize the backing arrays -
enqueue
void enqueue(double e) Method to insert a element into the PriorityQueue- Parameter:
e- the element that should be inserted
-
enqueueAll
default void enqueueAll(double... e) Method to mass insert elements into the PriorityQueue- Parameter:
e- the elements that should be inserted
-
enqueueAll
default void enqueueAll(double[] e, int length) Method to mass insert elements into the PriorityQueue- Parameter:
e- the elements that should be insertedlength- the amount of elements that should be inserted
-
enqueueAll
default void enqueueAll(double[] e, int offset, int length) Method to mass insert elements into the PriorityQueue- 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
Method to mass insert elements into the PriorityQueue- Parameter:
c- the elements that should be inserted from the Collection
-
dequeue
double dequeue()Method to extract a element from the PriorityQueue- Gibt zurück:
- a element from the Queue
- Löst aus:
NoSuchElementException- if no element is present
-
peek
double peek(int index) Peeking function to see whats inside the queue.- Parameter:
index- of the element that is requested to be viewed.- Gibt zurück:
- the element that is requested
-
first
default double first()Shows the element that is to be returned next- Gibt zurück:
- the first element in the Queue
-
contains
boolean contains(double e) Method to find out if a element is part of the queue- Parameter:
e- the element that is searched for- Gibt zurück:
- true if the element is in the queue
-
removeFirst
boolean removeFirst(double e) Removes the first found element in the queue- Parameter:
e- the element that should be removed- Gibt zurück:
- if a searched element was removed
-
removeLast
boolean removeLast(double e) Removes the last found element in the queue- Parameter:
e- the element that should be removed- Gibt zurück:
- if a searched element was removed
-
onChanged
void onChanged()Allows to notify the Queue to be revalidate its data -
copy
DoublePriorityQueue copy()A 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- Gibt zurück:
- a Shallow Copy of the PriorityQueue
- Note:
- Wrappers and view PriorityQueues will not support this feature
-
comparator
DoubleComparator comparator()- Gibt zurück:
- the sorter of the Queue, can be null
-
synchronizeQueue
Creates a Wrapped PriorityQueue that is Synchronized- Gibt zurück:
- a new PriorityQueue that is synchronized
- Siehe auch:
-
synchronizeQueue
Creates a Wrapped PriorityQueue that is Synchronized- Parameter:
mutex- is the controller of the synchronization block- Gibt zurück:
- a new PriorityQueue Wrapper that is synchronized
- Siehe auch:
-
toDoubleArray
default double[] toDoubleArray()A method to drop the contents of the Queue without clearing the queue- Angegeben von:
toDoubleArrayin SchnittstelleDoubleIterable- Gibt zurück:
- the contents of the queue into a seperate array.
-
toDoubleArray
double[] toDoubleArray(double[] input) A method to drop the contents of the Queue without clearing the queue- 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.
- Note:
- if the Type is generic then a Object Array is created instead of a Type Array
-