namespace System.Collections {
-#if NET_2_0
[ComVisible(true)]
-#endif
+ [System.Diagnostics.DebuggerDisplay ("Count={Count}")]
+ [System.Diagnostics.DebuggerTypeProxy (typeof (CollectionDebuggerView))]
[Serializable]
- public class Stack : ICollection, IEnumerable, ICloneable {
+#if INSIDE_CORLIB
+ public
+#else
+ internal
+#endif
+ class Stack : ICollection, IEnumerable, ICloneable {
// properties
private object[] contents;
private void Resize(int ncapacity)
{
- ncapacity = Math.Max (ncapacity, 16);
+ ncapacity = Math.Max (ncapacity, default_capacity);
object[] ncontents = new object[ncapacity];
Array.Copy(contents, ncontents, count);
capacity = default_capacity;
}
- public Stack(ICollection col) : this (col == null ? 16 : col.Count) {
+ public Stack(ICollection col) : this (col == null ? default_capacity : col.Count) {
if (col == null)
throw new ArgumentNullException("col");
}
}
- public static Stack Synchronized(Stack s) {
- if (s == null) {
- throw new ArgumentNullException();
- }
+ public static Stack Synchronized (Stack stack)
+ {
+ if (stack == null)
+ throw new ArgumentNullException ("stack");
- return new SyncStack(s);
+ return new SyncStack (stack);
}
public virtual int Count {
}
}
- public virtual void Push(Object o) {
+ public virtual void Push (Object obj)
+ {
modCount++;
if (capacity == count) {
count++;
current++;
- contents[current] = o;
+ contents[current] = obj;
}
public virtual object[] ToArray() {