This documentation is archived and is not being maintained.

Queue Constructor (ICollection)

.NET Framework 1.1

Initializes a new instance of the Queue class that contains elements copied from the specified collection, has the same initial capacity as the number of elements copied and uses the default growth factor.

[Visual Basic]
Public Sub New( _
   ByVal col As ICollection _
)
[C#]
public Queue(
   ICollection col
);
[C++]
public: Queue(
   ICollection* col
);
[JScript]
public function Queue(
   col : ICollection
);

Parameters

col
The ICollection to copy elements from.

Exceptions

Exception Type Condition
ArgumentNullException col is a null reference (Nothing in Visual Basic).

Remarks

The initial capacity is the starting capacity of the new Queue. The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The default initial capacity is 32 and the default growth factor is 2.0.

The elements are copied onto the Queue in the same order they are read by the IEnumerator of the ICollection.

If the number of elements added to the Queue reaches the current capacity, the capacity is automatically increased. The new capacity is determined by multiplying the current capacity by the growth factor.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Queue Class | Queue Members | System.Collections Namespace | Queue Constructor Overload List | ICollection

Show: