Abstract Priority Queue.
More...
|
abstract T | Poll () |
| Removes the head of the queue and returns it. More...
|
|
virtual T | Peek () |
| Returns the head of the queue without removing it. More...
|
|
abstract void | Add (T item) |
| Adds an item to the queue. The item is added at the correct position according to the current order. More...
|
|
abstract void | Clear () |
| Clears the queue. More...
|
|
abstract bool | Contains (T item) |
| Checks if an element is inside the queue. The comparison is done using the current order rather than object.Equals(object). More...
|
|
virtual void | CopyTo (T[] array, int arrayIndex) |
| Copies the elements of the queue to an array, preserving the order. More...
|
|
abstract bool | Remove (T item) |
| Removes an item from the queue. More...
|
|
IEnumerator< T > | GetEnumerator () |
|
|
IComparer< T > | Comparer [get, protected set] |
| The comparer used to order the elements in the queue. Can be null if T implements IComparable<T>. More...
|
|
virtual int | Count [get] |
| The number of elements in the queue. More...
|
|
bool | IsReadOnly [get] |
| Always false More...
|
|
int | Capacity [get, set] |
| The internal capacity of the internal array. It is automatically expended when needed. Can be set if it can be estimated, thus avoiding multiple resize, or to reduce its size if the number of elements has been considerably reduced. More...
|
|
Abstract Priority Queue.
- Template Parameters
-
T | The type of the elements in the queue. |
Constructs a new priority queue with a default capacity and no elements.
- Parameters
-
comparer | the comparer to use for ordering elements |
- Exceptions
-
InvalidOperationException | if T does not implement IComparable<T> and comparer is null. |
Constructs a new priority queue with the specified capacity and no elements.
- Parameters
-
capacity | the initial capacity |
comparer | the comparer to use for ordering elements |
- Exceptions
-
InvalidOperationException | if T does not implement IComparable<T> and comparer is null. |
Constructs a new priority queue and initializes it with the given elements.
- Parameters
-
enumerable | an enumerable containing the initial elements |
comparer | the comparer to use for ordering elements |
- Exceptions
-
InvalidOperationException | if T does not implement IComparable<T> and comparer is null. |
Copies the elements of the queue to an array, preserving the order.
- Parameters
-
array | the array to copy the elements to |
arrayIndex | the index where to start copying |
- Exceptions
-
ArgumentOutOfRangeException | if the size of array is lower than arrayIndex + Count. |
Reimplemented in Summer.Batch.Common.Collections.PriorityBlockingQueue< T >.
Adds an item to the queue.
- Parameters
-
Checks if an item is present in the queue.
- Parameters
-
item | The item to search for. |
- Returns
true
if item is present in the queue, false
otherwise.
Removes the head and returns it.
- Returns
- The element that was previously the head of the queue, or
default(T)
if the queue was empty.
Removes an item from the queue.
- Parameters
-
- Returns
true
if the item was actually removed; false
otherwise.
- See also
- IEnumerable::GetEnumerator
- Returns
The internal capacity of the internal array. It is automatically expended when needed. Can be set if it can be estimated, thus avoiding multiple resize, or to reduce its size if the number of elements has been considerably reduced.
The comparer used to order the elements in the queue. Can be null if T implements IComparable<T>.
The number of elements in the queue.
The documentation for this class was generated from the following file:
- Summer.Batch.Common/Collections/AbstractPriorityQueue.cs