![Collapse image](collapse_all.gif)
![Expand Image](expand_all.gif)
![CollapseAll image](collall.gif)
![ExpandAll image](expall.gif)
![DropDown image](drpdown.gif)
![DropDownHover image](drpdown_orange.gif)
![Copy image](copycode.gif)
![CopyHover image](copycodeHighlight.gif)
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Syntax
C# |
---|
[SerializableAttribute] public class Deque<T> |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class Deque(Of T) |
Visual C++ |
---|
[SerializableAttribute] generic<typename T> public ref class Deque |
Type Parameters
- T
The type exposes the following methods.
Public Methods
Name | Description | |
---|---|---|
![]() | Add |
Adds an item to the back of the Deque. The indices of all existing items
in the Deque are unchanged. This method is
equivalent to AddToBack(item).
|
![]() | AddManyToBack |
Adds a collection of items to the back of the Deque. The indices of all existing items
in the Deque are unchanged. The last item in the added collection becomes the
last item in the Deque.
|
![]() | AddManyToFront |
Adds a collection of items to the front of the Deque. The indices of all existing items
in the Deque are increased by the number of items inserted. The first item in the added collection becomes the
first item in the Deque.
|
![]() | AddToBack |
Adds an item to the back of the Deque. The indices of all existing items
in the Deque are unchanged. This method is
equivalent to Insert(Count, item) but is a little more
efficient.
|
![]() | AddToFront |
Adds an item to the front of the Deque. The indices of all existing items
in the Deque are increased by 1. This method is
equivalent to Insert(0, item) but is a little more
efficient.
|
![]() | AsReadOnly |
Provides a read-only view of this list. The returned IList<T> provides
a view of the list that prevents modifications to the list. Use the method to provide
access to the list without allowing changes. Since the returned object is just a view,
changes to the list will be reflected in the view.
(Inherited from ListBase<(Of <T>)>.) |
![]() | Clear |
Removes all items from the Deque.
(Overrides ListBase<(Of <T>)>..::Clear()().) |
![]() | Clone |
Creates a new Deque that is a copy of this one.
|
![]() | CloneContents |
Makes a deep clone of this Deque. A new Deque is created with a clone of
each element of this set, by calling ICloneable.Clone on each element. If T is
a value type, then each element is copied as if by simple assignment.
|
![]() | Contains |
Determines if the list contains any item that compares equal to item.
The implementation simply checks whether IndexOf(item) returns a non-negative value.
(Inherited from ListBase<(Of <T>)>.) |
![]() | ConvertAll<(Of <TOutput>)> |
Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration
contains the result of applying converter to each item in this collection, in
order.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | CopyTo | Overloaded. |
![]() | CountWhere |
Counts the number of items in the collection that satisfy the condition
defined by predicate.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | Equals | (Inherited from Object.) |
![]() | Exists |
Determines if the collection contains any item that satisfies the condition
defined by predicate.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | Find |
Finds the first item in the list that satisfies the condition
defined by predicate. If no item matches the condition, than
the default value for T (null or all-zero) is returned.
(Inherited from ListBase<(Of <T>)>.) |
![]() | FindAll |
Enumerates the items in the collection that satisfy the condition defined
by predicate.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | FindIndex | Overloaded. |
![]() | FindLast |
Finds the last item in the list that satisfies the condition
defined by predicate. If no item matches the condition, than
the default value for T (null or all-zero) is returned.
(Inherited from ListBase<(Of <T>)>.) |
![]() | FindLastIndex | Overloaded. |
![]() | ForEach |
Performs the specified action on each item in this collection.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | GetAtBack |
Retreives the item currently at the back of the Deque. The Deque is
unchanged. This method is
equivalent to deque[deque.Count - 1] (except that a different exception is thrown).
|
![]() | GetAtFront |
Retreives the item currently at the front of the Deque. The Deque is
unchanged. This method is
equivalent to deque[0] (except that a different exception is thrown).
|
![]() | GetEnumerator |
Enumerates all of the items in the list, in order. The item at index 0
is enumerated first, then the item at index 1, and so on. If the items
are added to or removed from the Deque during enumeration, the
enumeration ends with an InvalidOperationException.
(Overrides ListBase<(Of <T>)>..::GetEnumerator()().) |
![]() | GetHashCode | Serves as a hash function for a particular type. GetHashCode()() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IndexOf | Overloaded. |
![]() | Insert |
Inserts a new item at the given index in the Deque. All items at indexes
equal to or greater than index move up one index
in the Deque.
|
![]() | InsertRange |
Inserts a collection of items at the given index in the Deque. All items at indexes
equal to or greater than index increase their indices in the Deque
by the number of items inserted.
|
![]() | LastIndexOf | Overloaded. |
![]() | Range |
Returns a view onto a sub-range of this list. Items are not copied; the
returned IList<T> is simply a different view onto the same underlying items. Changes to this list
are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the
view, but insertions and deletions in the underlying list do not.
(Inherited from ListBase<(Of <T>)>.) |
![]() | Remove |
Searches the list for the first item that compares equal to item.
If one is found, it is removed. Otherwise, the list is unchanged.
(Inherited from ListBase<(Of <T>)>.) |
![]() | RemoveAll |
Removes all the items in the collection that satisfy the condition
defined by predicate.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | RemoveAt |
Removes the item at the given index in the Deque. All items at indexes
greater than index move down one index
in the Deque.
(Overrides ListBase<(Of <T>)>..::RemoveAt(Int32).) |
![]() | RemoveFromBack |
Removes an item from the back of the Deque. The indices of all existing items
in the Deque are unchanged. This method is
equivalent to RemoveAt(Count-1) but is a little more
efficient.
|
![]() | RemoveFromFront |
Removes an item from the front of the Deque. The indices of all existing items
in the Deque are decreased by 1. This method is
equivalent to RemoveAt(0) but is a little more
efficient.
|
![]() | RemoveRange |
Removes a range of items at the given index in the Deque. All items at indexes
greater than index move down count indices
in the Deque.
|
![]() | ToArray |
Creates an array of the correct size, and copies all the items in the
collection into the array, by calling CopyTo.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | ToString |
Shows the string representation of the collection. The string representation contains
a list of the items in the collection. Contained collections (except string) are expanded
recursively.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | TrimToSize |
Trims the amount of memory used by the Deque by changing
the Capacity to be equal to Count. If no more items will be added
to the Deque, calling TrimToSize will reduce the amount of memory
used by the Deque.
|
![]() | TrueForAll |
Determines if all of the items in the collection satisfy the condition
defined by predicate.
(Inherited from CollectionBase<(Of <T>)>.) |
![]() | TryFind |
Finds the first item in the list that satisfies the condition
defined by predicate.
(Inherited from ListBase<(Of <T>)>.) |
![]() | TryFindLast |
Finds the last item in the list that satisfies the condition
defined by predicate.
(Inherited from ListBase<(Of <T>)>.) |
Protected Methods
Name | Description | |
---|---|---|
![]() | Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
Explicit Interface Implementations
Name | Description | |||||
---|---|---|---|---|---|---|
![]() ![]() | ICollection..::CopyTo |
Copies all the items in the collection into an array. Implemented by
using the enumerator returned from GetEnumerator to get all the items
and copy them to the provided array.
(Inherited from CollectionBase<(Of <T>)>.) | ||||
![]() ![]() | IEnumerable..::GetEnumerator |
Provides an IEnumerator that can be used to iterate all the members of the
collection. This implementation uses the IEnumerator<T> that was overridden
by the derived classes to enumerate the members of the collection.
(Inherited from CollectionBase<(Of <T>)>.) | ||||
![]() ![]() | IList..::Add |
Adds an item to the end of the list. This method is equivalent to calling:
(Inherited from ListBase<(Of <T>)>.)
| ||||
![]() ![]() | IList..::Clear |
Removes all the items from the list, resulting in an empty list.
(Inherited from ListBase<(Of <T>)>.) | ||||
![]() ![]() | IList..::Contains |
Determines if the list contains any item that compares equal to value.
(Inherited from ListBase<(Of <T>)>.) | ||||
![]() ![]() | IList..::IndexOf |
Find the first occurrence of an item equal to value
in the list, and returns the index of that item.
(Inherited from ListBase<(Of <T>)>.) | ||||
![]() ![]() | IList..::Insert |
Insert a new
item at the given index.
(Inherited from ListBase<(Of <T>)>.) | ||||
![]() ![]() | IList..::Remove |
Searches the list for the first item that compares equal to value.
If one is found, it is removed. Otherwise, the list is unchanged.
(Inherited from ListBase<(Of <T>)>.) | ||||
![]() ![]() | IList..::RemoveAt |
Removes the
item at the given index.
(Inherited from ListBase<(Of <T>)>.) | ||||
![]() ![]() | ICloneable..::Clone |
Creates a new Deque that is a copy of this one.
|
See Also
Wintellect.PowerCollections Namespace