-//
+//
// System.Collections.Queue
//
// Author:
namespace System.Collections {
-#if NET_2_0
[ComVisible(true)]
-#endif
+ [System.Diagnostics.DebuggerDisplay ("Count={Count}")]
+ [System.Diagnostics.DebuggerTypeProxy (typeof (CollectionDebuggerView))]
[Serializable]
- public class Queue : ICollection, IEnumerable, ICloneable {
+#if INSIDE_CORLIB
+ public
+#else
+ internal
+#endif
+ class Queue : ICollection, IEnumerable, ICloneable {
private object[] _array;
private int _head = 0; // points to the first used slot
private int _version = 0;
public Queue () : this (32, 2.0F) {}
- public Queue (int initialCapacity) : this (initialCapacity, 2.0F) {}
+
+ public Queue (int capacity) : this (capacity, 2.0F) {}
+
public Queue(ICollection col) : this (col == null ? 32 : col.Count)
{
if (col == null)
Enqueue (o);
}
- public Queue (int initialCapacity, float growFactor) {
- if (initialCapacity < 0)
+ public Queue (int capacity, float growFactor) {
+ if (capacity < 0)
throw new ArgumentOutOfRangeException("capacity", "Needs a non-negative number");
if (!(growFactor >= 1.0F && growFactor <= 10.0F))
throw new ArgumentOutOfRangeException("growFactor", "Queue growth factor must be between 1.0 and 10.0, inclusive");
- _array = new object[initialCapacity];
+ _array = new object[capacity];
this._growFactor = (int)(growFactor * 100);
}
CopyTo (trimmed, 0);
_array = trimmed;
_head = 0;
- _tail = _head + _size;
+ _tail = 0;
}
// private methods