Parcourir la source

2005-11-10 Zoltan Varga <[email protected]>

	* Stack.cs SortedList.cs LinkedList.cs: Update to net 2.0 RTM.

svn path=/trunk/mcs/; revision=52842
Zoltan Varga il y a 20 ans
Parent
commit
1de1152ae9

+ 4 - 0
mcs/class/System/System.Collections.Generic/ChangeLog

@@ -1,3 +1,7 @@
+2005-11-10  Zoltan Varga  <[email protected]>
+
+	* Stack.cs SortedList.cs LinkedList.cs: Update to net 2.0 RTM.
+
 2005-11-09  Zoltan Varga  <[email protected]>
 
 	* SortedList.cs: New file.

+ 21 - 15
mcs/class/System/System.Collections.Generic/SortedList.cs

@@ -68,28 +68,28 @@ namespace System.Collections.Generic {
 		// Constructors
 		//
 		public SortedList () 
-			: this (null, INITIAL_SIZE)
+			: this (INITIAL_SIZE, null)
 		{
 		}
 
-		public SortedList (int initialCapacity)
-			: this (null, initialCapacity)
+		public SortedList (int capacity)
+			: this (capacity, null)
 		{
 		}
 
-		public SortedList (IComparer<TKey> comparer, int initialCapacity)
+		public SortedList (int capacity, IComparer<TKey> comparer)
 		{
-			if (initialCapacity < 0)
+			if (capacity < 0)
 				throw new ArgumentOutOfRangeException ("initialCapacity");
 
-			if (initialCapacity == 0)
+			if (capacity == 0)
 				defaultCapacity = 0;
 			else
 				defaultCapacity = INITIAL_SIZE;
-			Init (comparer, initialCapacity, true);
+			Init (comparer, capacity, true);
 		}
 
-		public SortedList (IComparer<TKey> comparer) : this (comparer, INITIAL_SIZE)
+		public SortedList (IComparer<TKey> comparer) : this (INITIAL_SIZE, comparer)
 		{
 		}
 
@@ -120,13 +120,13 @@ namespace System.Collections.Generic {
 			}
 		}
 
-		public virtual bool IsSynchronized {
+		bool ICollection.IsSynchronized {
 			get {
 				return false;
 			}
 		}
 
-		public virtual Object SyncRoot {
+		Object ICollection.SyncRoot {
 			get {
 				return this;
 			}
@@ -134,13 +134,13 @@ namespace System.Collections.Generic {
 
 		// IDictionary
 
-		public virtual bool IsFixedSize {
+		bool IDictionary.IsFixedSize {
 			get {
 				return false;
 			}
 		}
 
-		public virtual bool IsReadOnly {
+		bool IDictionary.IsReadOnly {
 			get {
 				return false;
 			}
@@ -183,7 +183,7 @@ namespace System.Collections.Generic {
 			}
 		}
 
-		public virtual int Capacity {
+		public int Capacity {
 			get {
 				return table.Length;
 			}
@@ -256,6 +256,12 @@ namespace System.Collections.Generic {
 			}
 		}
 
+		public IComparer<TKey> Comparer {
+			get {
+				return comparer;
+			}
+		}
+
 		//
 		// Public instance methods.
 		//
@@ -311,7 +317,7 @@ namespace System.Collections.Generic {
 			modificationCount++;
 		}
 
-		public virtual void CopyTo (Array array, int arrayIndex)
+		void ICollection<KeyValuePair<TKey, TValue>>.CopyTo (Array array, int arrayIndex)
 		{
 			if (null == array)
 				throw new ArgumentNullException();
@@ -437,7 +443,7 @@ namespace System.Collections.Generic {
 		// SortedList<TKey, TValue>
 		//
 
-		public virtual void RemoveAt (int index)
+		public void RemoveAt (int index)
 		{
 			KeyValuePair<TKey, TValue> [] table = this.table;
 			int cnt = Count;

+ 4 - 9
mcs/class/System/System.Collections.Generic/Stack.cs

@@ -133,16 +133,11 @@ namespace System.Collections.Generic
 			CopyTo (copy, 0);
 			return copy;
 		}
-		
-		public void TrimToSize ()
+
+		[MonoTODO]
+		public void TrimExcess ()
 		{
-			// for some broken reason, msft increments the version here
-			ver ++;
-			
-			if (size == 0)
-				data = null;
-			else
-				Array.Resize <T> (ref data, size);
+			throw new NotImplementedException ();
 		}
 		
 		public int Count {