Click or drag to resize
DigitalRuneDequeT Class
Represents a double-ended queue (deque) of objects.
Inheritance Hierarchy
SystemObject
  DigitalRune.CollectionsDequeT

Namespace: DigitalRune.Collections
Assembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax
public class Deque<T> : IList<T>, ICollection<T>, 
	IEnumerable<T>, IEnumerable, ICollection

Type Parameters

T
Specifies the type of elements in the deque.

The DequeT type exposes the following members.

Constructors
  NameDescription
Public methodDequeT
Initializes a new instance of the DequeT class that is empty and has the default initial capacity.
Public methodDequeT(IEnumerableT)
Initializes a new instance of the DequeT class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
Public methodDequeT(Int32)
Initializes a new instance of the DequeT class is empty and has the specified initial capacity.
Top
Methods
  NameDescription
Public methodClear
Removes all items from the DequeT.
Public methodContains
Determines whether the DequeT contains a specific value.
Public methodCopyTo
Copies the elements of the DequeT to an Array, starting at a particular Array index.
Public methodDequeueHead
Removes and returns the object at the beginning of the DequeT.
Public methodDequeueTail
Removes and returns the object at the end of the DequeT.
Public methodEnqueueHead
Adds an object to the beginning of the DequeT.
Public methodEnqueueTail
Adds an object to the end of the DequeT.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf
Determines the index of a specific item in the DequeT.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToArray
Copies the DequeT elements to a new array.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTrimExcess
Sets the capacity to the actual number of elements in the DequeT, if that number is less than 90 percent of current capacity.
Top
Extension Methods
  NameDescription
Public Extension MethodAddRangeT (Defined by CollectionHelper.)
Public Extension MethodDoT(ActionT)Overloaded.
Performs the given action on each element in a sequence when it is enumerated.
(Defined by LinqHelper.)
Public Extension MethodDoT(ActionT, Int32)Overloaded.
Performs the given action on each element (incorporating its index) in a sequence when it is enumerated.
(Defined by LinqHelper.)
Public Extension MethodForEachT(ActionT)Overloaded.
Immediately performs the given action on each element in a sequence.
(Defined by LinqHelper.)
Public Extension MethodForEachT(ActionT, Int32)Overloaded.
Immediately performs the given action on each element (incorporating its index) in a sequence.
(Defined by LinqHelper.)
Public Extension MethodIndexOfT
Returns the index of the first element in a sequence that satisfies the specified condition.
(Defined by LinqHelper.)
Top
Properties
  NameDescription
Public propertyCount
Gets the number of items contained in the DequeT.
Public propertyHead
Gets or sets the object at the beginning of the DequeT.
Public propertyItem
Gets or sets the item at the specified index.
Public propertyTail
Gets or sets the object at the end of the DequeT.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodICollectionTAdd
Explicit interface implementationPrivate methodICollectionCopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
Explicit interface implementationPrivate methodIEnumerableTGetEnumerator
Returns an enumerator that iterates through the collection.
Explicit interface implementationPrivate methodIEnumerableGetEnumerator
Returns an enumerator that iterates through a collection.
Explicit interface implementationPrivate methodIListTInsert
Explicit interface implementationPrivate propertyICollectionTIsReadOnly
Explicit interface implementationPrivate propertyICollectionIsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
Explicit interface implementationPrivate methodICollectionTRemove
Explicit interface implementationPrivate methodIListTRemoveAt
Explicit interface implementationPrivate propertyICollectionSyncRoot
Gets an object that can be used to synchronize access to the ICollection.
Top
Remarks

A deque is similar to a queue except that objects can inserted and removed at both ends. The capacity of a DequeT is the number of elements the DequeT can hold. As elements are added to a DequeT, the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling TrimExcess.

DequeT accepts as a valid value for reference types and allows duplicate elements.

See Also