Doloro GDK 22 .1.0 Beta
by Tauri Interactive
|
An abstract data-type in which each element additionally has a "priority" associated with it. An element with high priority is served before an element with low priority.
TElement | Specifies the type of elements in the queue. |
TPriority | Specifies the type of priority measure in the queue. |
Public Member Functions | |
PriorityQueue () | |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that uses a default comparer. | |
PriorityQueue (int initialCapacity) | |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that has the specified initial capacity. More... | |
PriorityQueue (IComparer< TPriority > comparer) | |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that uses a specified comparer. More... | |
PriorityQueue (int initialCapacity, IComparer< TPriority > comparer) | |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that is empty, has the specified initial capacity, and uses a specified comparer. More... | |
PriorityQueue (IEnumerable<(TElement Element, TPriority Priority)> values) | |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a default comparer. More... | |
PriorityQueue (IEnumerable<(TElement Element, TPriority Priority)> values, IComparer< TPriority > comparer) | |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a specified comparer. More... | |
void | Enqueue (TElement element, TPriority priority) |
Adds an object to the into the PriorityQueue<TElement, TPriority> by its priority. More... | |
TElement | Peek () |
Returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>. More... | |
bool | TryPeek (out TElement element, out TPriority priority) |
Attempts to Peek the element with the lowest priority from the PriorityQueue<TElement, TPriority>. More... | |
TElement | Dequeue () |
Removes and returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>. More... | |
bool | TryDequeue (out TElement element, out TPriority priority) |
Attempts to Dequeue the object with the lowest priority from the PriorityQueue<TElement, TPriority>. More... | |
void | Clear () |
Removes all elements from the PriorityQueue<TElement, TPriority>. | |
void | CopyTo (Array array, int index) |
Copies the elements of the PriorityQueue<TElement, TPriority> to an Array, starting at a particular Array index. More... | |
TElement TPriority Priority[] | ToArray () |
Public Attributes | |
TElement | Element |
Copies the elements stored in the PriorityQueue<TElement, TPriority> to a new array. More... | |
Properties | |
int | Count [get] |
Gets the number of elements contained in the PriorityQueue<TElement, TPriority>. More... | |
IComparer< TPriority > | Comparer [get] |
Gets the IComparer<T> for the PriorityQueue<TElement, TPriority>. More... | |
bool | IsSynchronized [get] |
Gets a value that indicates whether access to the ICollection is synchronized with the SyncRoot. More... | |
object | SyncRoot [get] |
Gets an object that can be used to synchronize access to the ICollection. More... | |
Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue | ( | int | initialCapacity | ) |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that has the specified initial capacity.
initialCapacity | The initial number of elements that the PriorityQueue<TElement, TPriority> can contain. |
ArgumentOutOfRangeException | initialCapacity is less than zero. |
Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue | ( | IComparer< TPriority > | comparer | ) |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that uses a specified comparer.
comparer | The IComparer<T> to use when comparing elements. |
Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue | ( | int | initialCapacity, |
IComparer< TPriority > | comparer | ||
) |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that is empty, has the specified initial capacity, and uses a specified comparer.
initialCapacity | The initial number of elements that the PriorityQueue<TElement, TPriority> can contain. |
comparer | The IComparer<T> to use when comparing elements. |
ArgumentOutOfRangeException | initialCapacity is less than zero. |
Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue | ( | IEnumerable<(TElement Element, TPriority Priority)> | values | ) |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a default comparer.
values | The collection whose elements are copied to the new PriorityQueue<TElement, TPriority>. |
Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue | ( | IEnumerable<(TElement Element, TPriority Priority)> | values, |
IComparer< TPriority > | comparer | ||
) |
Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a specified comparer.
values | The collection whose elements are copied to the new PriorityQueue<TElement, TPriority>. |
comparer | The IComparer<T> to use when comparing elements. |
void Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.CopyTo | ( | Array | array, |
int | index | ||
) |
Copies the elements of the PriorityQueue<TElement, TPriority> to an Array, starting at a particular Array index.
array | The one-dimensional Array that is the destination of the elements copied from the PriorityQueue<TElement, TPriority>. The Array must have zero-based indexing. |
index | The zero-based index in array at which copying begins. |
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | index is less than zero. -or- index is equal to or greater than the length of the array |
ArgumentNullException | array is null. |
ArgumentException | The number of elements in the source ICollection is greater than the available space from index to the end of the destination array . |
TElement Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Dequeue | ( | ) |
Removes and returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>.
InvalidOperationException | The PriorityQueue<TElement, TPriority> is empty. |
void Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Enqueue | ( | TElement | element, |
TPriority | priority | ||
) |
Adds an object to the into the PriorityQueue<TElement, TPriority> by its priority.
element | The object to add to the PriorityQueue<TElement, TPriority>. The value can be null for reference types. |
priority | The priority of the object at the queue. |
TElement Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Peek | ( | ) |
Returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>.
InvalidOperationException | The PriorityQueue<TElement, TPriority> is empty. |
bool Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.TryDequeue | ( | out TElement | element, |
out TPriority | priority | ||
) |
Attempts to Dequeue the object with the lowest priority from the PriorityQueue<TElement, TPriority>.
element | Dequeued element. |
priority | Dequeued element's priority. |
bool Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.TryPeek | ( | out TElement | element, |
out TPriority | priority | ||
) |
Attempts to Peek the element with the lowest priority from the PriorityQueue<TElement, TPriority>.
element | Dequeued element. |
priority | Dequeued element's priority. |
TElement Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Element |
Copies the elements stored in the PriorityQueue<TElement, TPriority> to a new array.
|
get |
Gets the IComparer<T> for the PriorityQueue<TElement, TPriority>.
The IComparer<T> that is used when comparing elements in the PriorityQueue<TElement, TPriority>.
|
get |
Gets the number of elements contained in the PriorityQueue<TElement, TPriority>.
The number of elements contained in the PriorityQueue<TElement, TPriority>.
|
get |
Gets a value that indicates whether access to the ICollection is synchronized with the SyncRoot.
true if access to the ICollection is synchronized with the SyncRoot; otherwise, false. For PriorityQueue<TElement, TPriority>, this property always returns false.
|
get |
Gets an object that can be used to synchronize access to the ICollection.
An object that can be used to synchronize access to the ICollection.