Priority Blocking Queue; inherits from AbstractPriorityQueue More...
Public Member Functions | |
PriorityBlockingQueue (IComparer< T > comparer=null) | |
Constructs a new priority queue with a default capacity and no elements. More... | |
PriorityBlockingQueue (int capacity, IComparer< T > comparer=null) | |
Constructs a new priority queue with the specified capacity and no elements. More... | |
PriorityBlockingQueue (IEnumerable< T > enumerable, IComparer< T > comparer=null) | |
Constructs a new priority queue and initializes it with the given elements. More... | |
override T | Poll () |
Removes the head of the queue and returns it. More... | |
T | Take () |
Removes the head of the queue and returns it. If the queue is empty, waits until an element is added. More... | |
override T | Peek () |
Returns the head of the queue without removing it. More... | |
override void | Add (T item) |
Adds an item to the queue. The item is added at the correct position according to the current order. More... | |
override void | Clear () |
Removes all elements from the queue. More... | |
override 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... | |
override void | CopyTo (T[] array, int arrayIndex) |
Copies the elements of the queue to an array, preserving the order. More... | |
override bool | Remove (T item) |
Removes an item from the queue. More... | |
Public Member Functions inherited from Summer.Batch.Common.Collections.AbstractPriorityQueue< T > | |
IEnumerator< T > | GetEnumerator () |
Properties | |
override int | Count [get] |
The number of elements in the queue. More... | |
Properties inherited from Summer.Batch.Common.Collections.AbstractPriorityQueue< T > | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from Summer.Batch.Common.Collections.AbstractPriorityQueue< T > | |
AbstractPriorityQueue (IComparer< T > comparer=null) | |
Constructs a new priority queue with a default capacity and no elements. More... | |
AbstractPriorityQueue (int capacity, IComparer< T > comparer=null) | |
Constructs a new priority queue with the specified capacity and no elements. More... | |
AbstractPriorityQueue (IEnumerable< T > enumerable, IComparer< T > comparer=null) | |
Constructs a new priority queue and initializes it with the given elements. More... | |
T | DoPoll () |
Removes the head and returns it. More... | |
void | DoAdd (T item) |
Adds an item to the queue. More... | |
void | DoClear () |
Clears the queue. More... | |
bool | DoRemove (T item) |
Removes an item from the queue. More... | |
bool | DoContains (T item) |
Checks if an item is present in the queue. More... | |
Detailed Description
Priority Blocking Queue; inherits from AbstractPriorityQueue
- Template Parameters
-
T The type of the elements in the queue.
Constructor & Destructor Documentation
Summer.Batch.Common.Collections.PriorityBlockingQueue< T >.PriorityBlockingQueue | ( | IComparer< T > | comparer = null | ) |
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.
Summer.Batch.Common.Collections.PriorityBlockingQueue< T >.PriorityBlockingQueue | ( | int | capacity, |
IComparer< T > | comparer = 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.
Summer.Batch.Common.Collections.PriorityBlockingQueue< T >.PriorityBlockingQueue | ( | IEnumerable< T > | enumerable, |
IComparer< T > | comparer = 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.
Member Function Documentation
|
virtual |
Adds an item to the queue. The item is added at the correct position according to the current order.
- Parameters
-
item the item to add
Implements Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
|
virtual |
Removes all elements from the queue.
Implements Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
|
virtual |
Checks if an element is inside the queue. The comparison is done using the current order rather than object.Equals(object).
- Parameters
-
item the item to check
- Returns
- true if there is an item with the same order as item ; false otherwise
Implements Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
|
virtual |
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 + AbstractPriorityQueue<T>.Count.
Reimplemented from Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
|
virtual |
Returns the head of the queue without removing it.
- Returns
- the head of the queue
Reimplemented from Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
|
virtual |
Removes the head of the queue and returns it.
- Returns
- the head of the queue
Implements Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
|
virtual |
Removes an item from the queue.
- Parameters
-
item the item to remove
- Returns
- true if the item was removed from the queue; false otherwise
Implements Summer.Batch.Common.Collections.AbstractPriorityQueue< T >.
T Summer.Batch.Common.Collections.PriorityBlockingQueue< T >.Take | ( | ) |
Removes the head of the queue and returns it. If the queue is empty, waits until an element is added.
- Returns
Property Documentation
|
get |
The number of elements in the queue.
The documentation for this class was generated from the following file:
- Summer.Batch.Common/Collections/PriorityBlockingQueue.cs