Modul speiger.src.collections
Schnittstelle ObjectPriorityQueue<T>
- Typparameter:
T- the keyType of elements maintained by this Collection
- Alle Superschnittstellen:
Iterable<T>,ObjectIterable<T>
- Alle bekannten Unterschnittstellen:
ObjectPriorityDequeue<T>
- Alle bekannten Implementierungsklassen:
AbstractObjectPriorityQueue,ObjectArrayFIFOQueue,ObjectArrayPriorityQueue,ObjectHeapPriorityQueue,ObjectLinkedList,ObjectPriorityQueues.SynchronizedPriorityDequeue,ObjectPriorityQueues.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 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.dequeue()Method to extract a element from the PriorityQueuevoidMethod to insert a element into the PriorityQueuedefault voidenqueueAll(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 useabledefault voidMethod to mass insert elements into the PriorityQueuedefault voidenqueueAll(T... e) Method to mass insert elements into the PriorityQueuedefault voidenqueueAll(T[] e, int length) Method to mass insert elements into the PriorityQueuedefault voidenqueueAll(T[] e, int offset, int length) Method to mass insert elements into the PriorityQueuedefault Tfirst()Shows the element that is to be returned nextdefault booleanisEmpty()iterator()Returns an iterator over elements of typeT.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()default ObjectPriorityQueue<T>Creates a Wrapped PriorityQueue that is Synchronizeddefault ObjectPriorityQueue<T>synchronizeQueue(Object mutex) Creates a Wrapped PriorityQueue that is Synchronizeddefault <E> E[]toArray()A method to drop the contents of the Queue without clearing the queue<E> E[]toArray(E[] input) A method to drop the contents of the Queue without clearing the queuedefault <E> E[]toArray(IntFunction<E[]> action) A Helper function that simplifies the process of creating a new Array.Von Schnittstelle geerbte Methoden speiger.src.collections.objects.collections.ObjectIterable
arrayflatMap, asAsync, count, distinct, filter, findFirst, flatMap, forEach, forEachIndexed, limit, map, mapToBoolean, mapToByte, mapToDouble, mapToFloat, mapToInt, mapToLong, mapToShort, 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
Method to insert a element into the PriorityQueue- Parameter:
e- the element that should be inserted
-
enqueueAll
Method to mass insert elements into the PriorityQueue- Parameter:
e- the elements that should be inserted
-
enqueueAll
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
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
-
enqueueAll
Method to mass insert elements into the PriorityQueue This method exists to add support for Java Collections to make it more useable- Parameter:
c- the elements that should be inserted from the Collection
-
dequeue
T 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
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
Shows the element that is to be returned next- Gibt zurück:
- the first element in the Queue
-
contains
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
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
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
ObjectPriorityQueue<T> 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
Comparator<? super T> comparator()- Gibt zurück:
- the sorter of the Queue, can be null
-
iterator
ObjectIterator<T> iterator()Beschreibung aus Schnittstelle kopiert:ObjectIterableReturns an iterator over elements of typeT. -
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:
-
toArray
default <E> E[] toArray()A method to drop the contents of the Queue without clearing the queue- Typparameter:
E- the keyType of elements maintained by this Collection- Gibt zurück:
- the contents of the queue into a seperate array.
-
toArray
<E> E[] toArray(E[] input) A method to drop the contents of the Queue without clearing the queue- 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.
- Note:
- if the Type is generic then a Object Array is created instead of a Type Array
-
toArray
A Helper function that simplifies the process of creating a new Array.- Angegeben von:
toArrayin SchnittstelleObjectIterable<T>- Typparameter:
E- the returning arrayType- Parameter:
action- the array creation function- Gibt zurück:
- an array containing all of the elements in this collection
- Siehe auch:
-