Proton DotNet
|
A resizable-array implementation of the IDeque interface which has no capacity restrictions. The backing array will grow as necessary to support usage. This collection is not thread-safe. Null elements are prohibited in this collection. More...
Public Member Functions | |
ArrayDeque (uint size=DefaultInitialSize) | |
ArrayDeque (IEnumerable< T > elements) | |
bool | TryEnqueue (T value) |
Attempts to insert the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception. | |
void | Enqueue (T value) |
Inserts the given value onto the back of this queue unless the queue has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueue method and check the return value to determine if the operation succeeded. | |
bool | TryDequeue (out T front) |
Attempt to remove and return the element at the front of the queue if there is any element to return otherwise the method returns false. | |
T | Dequeue () |
Removes and returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryDequeue method and check the return value to see if the operation succeeded. | |
bool | TryEnqueueFront (T item) |
Attempts to insert the given value onto the front of this queue unless the queue has reached its capacity limit in which case this method would throw an exception. | |
void | EnqueueFront (T item) |
Inserts the given value onto the front of this queue unless the queue has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueueFront method and check the return value to determine if the operation succeeded. | |
bool | TryEnqueueBack (T item) |
Attempts to insert the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception. | |
void | EnqueueBack (T item) |
Inserts the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueueBack method and check the return value to determine if the operation succeeded. | |
bool | TryDequeueFront (out T result) |
Attempt to remove and return the element at the front of the queue if there is any element to return otherwise the method returns false. | |
T | DequeueFront () |
Removes and returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryDequeueFront method and check the return value to see if the operation succeeded. | |
bool | TryDequeueBack (out T result) |
Attempt to remove and return the element at the back of the queue if there is any element to return otherwise the method returns false. | |
T | DequeueBack () |
Removes and returns the element at the back of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryDequeue method and check the return value to see if the operation succeeded. | |
T | Peek () |
Returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryPeek method and check the return value to see if the operation succeeded. | |
bool | TryPeek (out T front) |
Attempt to read and return the element at the front of the queue if there is any element to return otherwise the method returns false. | |
T | PeekFront () |
Returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryPeek method and check the return value to see if the operation succeeded. | |
bool | TryPeekFront (out T front) |
Attempt to read and return the element at the front of the queue if there is any element to return otherwise the method returns false. | |
T | PeekBack () |
Returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryPeek method and check the return value to see if the operation succeeded. | |
bool | TryPeekBack (out T back) |
Attempt to read and return the element at the front of the queue if there is any element to return otherwise the method returns false. | |
void | Clear () |
bool | Contains (T item) |
void | CopyTo (T[] array, int index) |
void | CopyTo (Array array, int index) |
bool | Remove (T item) |
IEnumerator< T > | GetEnumerator () |
override bool | Equals (object other) |
bool | Equals (IEnumerable< T > other) |
override int | GetHashCode () |
![]() | |
void ICollection< T >. | Add (T item) |
Inserts the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueueBack method and check the return value to determine if the operation succeeded. | |
Public Attributes | |
readonly object | sync = new() |
Static Public Attributes | |
const int | DefaultInitialSize = 16 |
const int | AtLeastOne = 1 |
Properties | |
bool | IsEmpty [get] |
Returns true if the double ended queue is currently empty. This method provides an optimized means of checking for empty in this collection type where otherwise the count property might be used which could require a calculation on each call to determine the current element count. | |
int | Count [get] |
Returns the current number of elements contained in the double ended Queue. | |
bool | IsReadOnly [get] |
bool | IsSynchronized [get] |
object | SyncRoot [get] |
![]() |
A resizable-array implementation of the IDeque interface which has no capacity restrictions. The backing array will grow as necessary to support usage. This collection is not thread-safe. Null elements are prohibited in this collection.
H T
H T
T H
Following capacity increase when head > tail (or head == tail because of insert when one slot left)
T H
T | The type that is stored in this double ended queue implementation |
|
inline |
Removes and returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryDequeue method and check the return value to see if the operation succeeded.
InvalidOperationException | If the queue is currently empty |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Removes and returns the element at the back of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryDequeue method and check the return value to see if the operation succeeded.
InvalidOperationException | If the queue is currently empty |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Removes and returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryDequeueFront method and check the return value to see if the operation succeeded.
InvalidOperationException | If the queue is currently empty |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Inserts the given value onto the back of this queue unless the queue has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueue method and check the return value to determine if the operation succeeded.
value | The value to add to the tail of the queue |
InvalidOperationException | If the queue is currently at max capacity |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Inserts the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueueBack method and check the return value to determine if the operation succeeded.
value | The value to add to the back of the queue |
InvalidOperationException | If the queue is currently at max capacity |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Inserts the given value onto the front of this queue unless the queue has reached its capacity limit in which case this method would throw an exception. Generally it is preferable to call the TryEnqueueFront method and check the return value to determine if the operation succeeded.
value | The value to add to the front of the queue |
InvalidOperationException | If the queue is currently at max capacity |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryPeek method and check the return value to see if the operation succeeded.
InvalidOperationException | If the queue is currently empty |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryPeek method and check the return value to see if the operation succeeded.
InvalidOperationException | If the queue is currently empty |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Returns the element at the front of the queue if the queue is currently not empty, otherwise this method throws an exception to indicate that there is no value in the queue currently. Generally it is preferable to call the TryPeek method and check the return value to see if the operation succeeded.
InvalidOperationException | If the queue is currently empty |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempt to remove and return the element at the front of the queue if there is any element to return otherwise the method returns false.
front | A reference to store the value at the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempt to remove and return the element at the back of the queue if there is any element to return otherwise the method returns false.
back | A reference to store the value at the back of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempt to remove and return the element at the front of the queue if there is any element to return otherwise the method returns false.
front | A reference to store the value at the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempts to insert the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception.
value | The value to add to the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempts to insert the given value onto the back of this queue unless the deque has reached its capacity limit in which case this method would throw an exception.
value | The value to add to the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempts to insert the given value onto the front of this queue unless the queue has reached its capacity limit in which case this method would throw an exception.
value | The value to add to the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempt to read and return the element at the front of the queue if there is any element to return otherwise the method returns false.
front | A reference to store the value at the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempt to read and return the element at the front of the queue if there is any element to return otherwise the method returns false.
front | A reference to store the value at the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
inline |
Attempt to read and return the element at the front of the queue if there is any element to return otherwise the method returns false.
front | A reference to store the value at the front of the queue |
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
get |
Returns the current number of elements contained in the double ended Queue.
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.
|
get |
Returns true if the double ended queue is currently empty. This method provides an optimized means of checking for empty in this collection type where otherwise the count property might be used which could require a calculation on each call to determine the current element count.
Implements Apache.Qpid.Proton.Utilities.IDeque< T >.