Proton DotNet
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Apache.Qpid.Proton.Utilities.IDeque< T > Interface Template Reference

A linear collection type that supports element insertion and removal at both ends. This double ended queue type will most commonly be implemented with no underlying fixed capacity limit however the interface allows for restricted capacity versions to be implemented all the same. More...

Inheritance diagram for Apache.Qpid.Proton.Utilities.IDeque< T >:
Apache.Qpid.Proton.Utilities.ArrayDeque< T >

Public Member Functions

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 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 EnqueueFront (T value)
 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 TryEnqueueFront (T value)
 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 EnqueueBack (T value)
 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 TryEnqueueBack (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.
 
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 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.
 
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.
 
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.
 
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 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.
 
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 TryDequeueFront (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.
 
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.
 
bool TryDequeueBack (out T back)
 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.
 
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.
 

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.
 
new int Count [get]
 Returns the current number of elements contained in the double ended Queue.
 

Detailed Description

A linear collection type that supports element insertion and removal at both ends. This double ended queue type will most commonly be implemented with no underlying fixed capacity limit however the interface allows for restricted capacity versions to be implemented all the same.

This interface defines methods to access the elements at both ends of the deque. Methods are provided to insert, remove, and or peek at elements. Each of these methods exists in two forms: one throws an exception if the operation fails, the other returns a boolean value to indicate if the operation succeeded or failed. The try based form of the insert operation is designed specifically for use with capacity-restricted queue implementations; in most implementations, insert operations cannot fail.

Template Parameters
TThe type that is carried in this collection

Member Function Documentation

◆ Add()

void ICollection< T >. Apache.Qpid.Proton.Utilities.IDeque< T >.Add ( item)
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.

Parameters
valueThe value to add to the back of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently at max capacity

◆ 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.

Returns
The element at the front of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently empty

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ DequeueBack()

T Apache.Qpid.Proton.Utilities.IDeque< 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.

Returns
The element at the back of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently empty

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ DequeueFront()

T Apache.Qpid.Proton.Utilities.IDeque< 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.

Returns
The element at the front of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently empty

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ Enqueue()

void Apache.Qpid.Proton.Utilities.IDeque< T >.Enqueue ( 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.

Parameters
valueThe value to add to the tail of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently at max capacity

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ EnqueueBack()

void Apache.Qpid.Proton.Utilities.IDeque< T >.EnqueueBack ( value)

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.

Parameters
valueThe value to add to the back of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently at max capacity

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ EnqueueFront()

void Apache.Qpid.Proton.Utilities.IDeque< T >.EnqueueFront ( value)

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.

Parameters
valueThe value to add to the front of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently at max capacity

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< 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.

Returns
The element at the front of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently empty

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< 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.

Returns
The element at the front of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently empty

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< 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.

Returns
The element at the front of the queue
Exceptions
InvalidOperationExceptionIf the queue is currently empty

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryDequeue()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.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.

Parameters
frontA reference to store the value at the front of the queue
Returns
True if a value was removed from the queue and returned.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryDequeueBack()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.TryDequeueBack ( out T  back)

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.

Parameters
backA reference to store the value at the back of the queue
Returns
True if a value was removed from the queue and returned.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryDequeueFront()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.TryDequeueFront ( 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.

Parameters
frontA reference to store the value at the front of the queue
Returns
True if a value was removed from the queue and returned.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryEnqueue()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.TryEnqueue ( 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.

Parameters
valueThe value to add to the front of the queue
Returns
True if the value was added to the deque

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryEnqueueBack()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.TryEnqueueBack ( 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.

Parameters
valueThe value to add to the front of the queue
Returns
True if the value was added to the deque

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryEnqueueFront()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.TryEnqueueFront ( value)

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.

Parameters
valueThe value to add to the front of the queue
Returns
True if the value was added to the deque

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryPeek()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.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.

Parameters
frontA reference to store the value at the front of the queue
Returns
True if a value was read from the queue and returned.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryPeekBack()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.TryPeekBack ( 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.

Parameters
frontA reference to store the value at the front of the queue
Returns
True if a value was read from the queue and returned.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ TryPeekFront()

bool Apache.Qpid.Proton.Utilities.IDeque< T >.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.

Parameters
frontA reference to store the value at the front of the queue
Returns
True if a value was read from the queue and returned.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

Property Documentation

◆ Count

new int Apache.Qpid.Proton.Utilities.IDeque< T >.Count
get

Returns the current number of elements contained in the double ended Queue.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.

◆ IsEmpty

bool Apache.Qpid.Proton.Utilities.IDeque< T >.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.

Implemented in Apache.Qpid.Proton.Utilities.ArrayDeque< T >.


The documentation for this interface was generated from the following file: