[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Collections ArrayList
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Collections ArrayList.cs,1.14,1.15 CaseInsensitiveComparer.cs,1.1,1.2 CaseInsensitiveHashCodeProvider.cs,1.1,1.2 Comparer.cs,1.3,1.4 DictionaryBase.cs,1.1,1.2 Hashtable.cs,1.8,1.9 IEnumerable.cs,1.2,1.3 IEnumerator.cs,1.2,1.3 Queue.cs,1.4,1.5 Stack.cs,1.3,1.4 |
Date: |
Wed, 23 Apr 2003 01:39:51 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections
In directory subversions:/tmp/cvs-serv9550/runtime/System/Collections
Modified Files:
ArrayList.cs CaseInsensitiveComparer.cs
CaseInsensitiveHashCodeProvider.cs Comparer.cs
DictionaryBase.cs Hashtable.cs IEnumerable.cs IEnumerator.cs
Queue.cs Stack.cs
Log Message:
Minor tweaks to a lot of classes to make them more signature compatible
with .NET Framework SDK 1.1.
Index: ArrayList.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/ArrayList.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** ArrayList.cs 15 Apr 2003 04:37:44 -0000 1.14
--- ArrayList.cs 23 Apr 2003 05:39:48 -0000 1.15
***************
*** 2,6 ****
* ArrayList.cs - Implementation of the "System.Collections.ArrayList" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* ArrayList.cs - Implementation of the "System.Collections.ArrayList" class.
*
! * Copyright (C) 2001, 2002, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 1492,1495 ****
--- 1492,1619 ----
}; // class FixedSizeWrapper
+ #if !ECMA_COMPAT
+
+ // Adapt an ordinary list to appear to have a fixed size.
+ public static IList FixedSize(IList list)
+ {
+ if(list == null)
+ {
+ throw new ArgumentNullException("list");
+ }
+ else
+ {
+ return new FixedSizeListWrapper(list);
+ }
+ }
+
+ // Wrapper class for fixed-sized lists.
+ private sealed class FixedSizeListWrapper : IList
+ {
+ // Internal state.
+ private IList list;
+
+ // Constructor.
+ public FixedSizeListWrapper(IList list)
+ {
+ this.list = list;
+ }
+
+ // Implement the IList interface.
+ public int Add(Object value)
+ {
+ throw new NotSupportedException
+
(_("NotSupp_FixedSizeCollection"));
+ }
+ public void Clear()
+ {
+ throw new NotSupportedException
+
(_("NotSupp_FixedSizeCollection"));
+ }
+ public bool Contains(Object value)
+ {
+ return list.Contains(value);
+ }
+ public int IndexOf(Object value)
+ {
+ return list.IndexOf(value);
+ }
+ public void Insert(int index, Object value)
+ {
+ throw new NotSupportedException
+
(_("NotSupp_FixedSizeCollection"));
+ }
+ public void Remove(Object value)
+ {
+ throw new NotSupportedException
+
(_("NotSupp_FixedSizeCollection"));
+ }
+ public void RemoveAt(int index)
+ {
+ throw new NotSupportedException
+
(_("NotSupp_FixedSizeCollection"));
+ }
+ public bool IsFixedSize
+ {
+ get
+ {
+ return true;
+ }
+ }
+ public bool IsReadOnly
+ {
+ get
+ {
+ return list.IsReadOnly;
+ }
+ }
+ public Object this[int index]
+ {
+ get
+ {
+ return list[index];
+ }
+ set
+ {
+ list[index] = value;
+ }
+ }
+
+ // Implement the ICollection interface.
+ public void CopyTo(Array array, int index)
+ {
+ list.CopyTo(array, index);
+ }
+ public int Count
+ {
+ get
+ {
+ return list.Count;
+ }
+ }
+ public bool IsSynchronized
+ {
+ get
+ {
+ return list.IsSynchronized;
+ }
+ }
+ public Object SyncRoot
+ {
+ get
+ {
+ return list.SyncRoot;
+ }
+ }
+
+ // Implement the IEnumerable interface.
+ public IEnumerator GetEnumerator()
+ {
+ return list.GetEnumerator();
+ }
+
+ }; // class FixedSizeListWrapper
+
+ #endif // !ECMA_COMPAT
+
// Adapt an array list to get access to a sub-range.
public virtual ArrayList GetRange(int index, int count)
***************
*** 1944,1947 ****
--- 2068,2196 ----
}; // class ReadOnlyWrapper
+ #if !ECMA_COMPAT
+
+ // Adapt an ordinary list to appear to be read-only.
+ public static IList ReadOnly(IList list)
+ {
+ if(list == null)
+ {
+ throw new ArgumentNullException("list");
+ }
+ else
+ {
+ return new ReadOnlyListWrapper(list);
+ }
+ }
+
+ // Wrapper class for read-only lists.
+ private sealed class ReadOnlyListWrapper : IList
+ {
+ // Internal state.
+ private IList list;
+
+ // Constructor.
+ public ReadOnlyListWrapper(IList list)
+ {
+ this.list = list;
+ }
+
+ // Implement the IList interface.
+ public int Add(Object value)
+ {
+ throw new NotSupportedException
+ (_("NotSupp_ReadOnly"));
+ }
+ public void Clear()
+ {
+ throw new NotSupportedException
+ (_("NotSupp_ReadOnly"));
+ }
+ public bool Contains(Object value)
+ {
+ return list.Contains(value);
+ }
+ public int IndexOf(Object value)
+ {
+ return list.IndexOf(value);
+ }
+ public void Insert(int index, Object value)
+ {
+ throw new NotSupportedException
+ (_("NotSupp_ReadOnly"));
+ }
+ public void Remove(Object value)
+ {
+ throw new NotSupportedException
+ (_("NotSupp_ReadOnly"));
+ }
+ public void RemoveAt(int index)
+ {
+ throw new NotSupportedException
+ (_("NotSupp_ReadOnly"));
+ }
+ public bool IsFixedSize
+ {
+ get
+ {
+ return list.IsFixedSize;
+ }
+ }
+ public bool IsReadOnly
+ {
+ get
+ {
+ return true;
+ }
+ }
+ public Object this[int index]
+ {
+ get
+ {
+ return list[index];
+ }
+ set
+ {
+ throw new NotSupportedException
+ (_("NotSupp_ReadOnly"));
+ }
+ }
+
+ // Implement the ICollection interface.
+ public void CopyTo(Array array, int index)
+ {
+ list.CopyTo(array, index);
+ }
+ public int Count
+ {
+ get
+ {
+ return list.Count;
+ }
+ }
+ public bool IsSynchronized
+ {
+ get
+ {
+ return list.IsSynchronized;
+ }
+ }
+ public Object SyncRoot
+ {
+ get
+ {
+ return list.SyncRoot;
+ }
+ }
+
+ // Implement the IEnumerable interface.
+ public IEnumerator GetEnumerator()
+ {
+ return list.GetEnumerator();
+ }
+
+ }; // class ReadOnlyListWrapper
+
+ #endif // !ECMA_COMPAT
+
// Adapt an array list to appear to be synchonrized
public static ArrayList Synchronized(ArrayList list)
***************
*** 2302,2305 ****
--- 2551,2717 ----
}; // class SynchronizedWrapper
+
+ #if !ECMA_COMPAT
+
+ // Adapt an ordinary list to appear to be synchronized.
+ public static IList Synchronized(IList list)
+ {
+ if(list == null)
+ {
+ throw new ArgumentNullException("list");
+ }
+ else
+ {
+ return new
SynchronizedListWrapper(list);
+ }
+ }
+
+ // Wrapper class for synchronized lists.
+ private sealed class SynchronizedListWrapper : IList
+ {
+ // Internal state.
+ private IList list;
+
+ // Constructor.
+ public SynchronizedListWrapper(IList list)
+ {
+ this.list = list;
+ }
+
+ // Implement the IList interface.
+ public int Add(Object value)
+ {
+ lock(SyncRoot)
+ {
+ return list.Add(value);
+ }
+ }
+ public void Clear()
+ {
+ lock(SyncRoot)
+ {
+ list.Clear();
+ }
+ }
+ public bool Contains(Object value)
+ {
+ lock(SyncRoot)
+ {
+ return list.Contains(value);
+
+ }
+ }
+ public int IndexOf(Object value)
+ {
+ lock(SyncRoot)
+ {
+ return list.IndexOf(value);
+ }
+ }
+ public void Insert(int index, Object value)
+ {
+ lock(SyncRoot)
+ {
+ list.Insert(index, value);
+ }
+ }
+ public void Remove(Object value)
+ {
+ lock(SyncRoot)
+ {
+ list.Remove(value);
+ }
+ }
+ public void RemoveAt(int index)
+ {
+ lock(SyncRoot)
+ {
+ list.RemoveAt(index);
+ }
+ }
+ public bool IsFixedSize
+ {
+ get
+ {
+ lock(SyncRoot)
+ {
+ return list.IsFixedSize;
+ }
+ }
+ }
+ public bool IsReadOnly
+ {
+ get
+ {
+ lock(SyncRoot)
+ {
+ return list.IsReadOnly;
+ }
+ }
+ }
+ public Object this[int index]
+ {
+ get
+ {
+ lock(SyncRoot)
+ {
+ return list[index];
+ }
+ }
+ set
+ {
+ lock(SyncRoot)
+ {
+ list[index] = value;
+ }
+ }
+ }
+
+ // Implement the ICollection interface.
+ public void CopyTo(Array array, int index)
+ {
+ lock(SyncRoot)
+ {
+ list.CopyTo(array, index);
+ }
+ }
+ public int Count
+ {
+ get
+ {
+ lock(SyncRoot)
+ {
+ return list.Count;
+ }
+ }
+ }
+ public bool IsSynchronized
+ {
+ get
+ {
+ return true;
+ }
+ }
+ public Object SyncRoot
+ {
+ get
+ {
+ return list.SyncRoot;
+ }
+ }
+
+ // Implement the IEnumerable interface.
+ public IEnumerator GetEnumerator()
+ {
+ lock(SyncRoot)
+ {
+ return new
SynchronizedEnumerator
+ (SyncRoot,
list.GetEnumerator());
+ }
+ }
+
+ }; // class SynchronizedListWrapper
+
+ #endif // !ECMA_COMPAT
}; // class ArrayList
Index: CaseInsensitiveComparer.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/CaseInsensitiveComparer.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** CaseInsensitiveComparer.cs 13 Dec 2001 05:26:29 -0000 1.1
--- CaseInsensitiveComparer.cs 23 Apr 2003 05:39:48 -0000 1.2
***************
*** 3,7 ****
* "System.Collections.CaseInsensitiveComparer" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 3,7 ----
* "System.Collections.CaseInsensitiveComparer" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 30,41 ****
public class CaseInsensitiveComparer : IComparer
{
! // The default case insensitive comparer instance.
private static readonly CaseInsensitiveComparer defaultComparer =
new CaseInsensitiveComparer();
// Internal state.
private CompareInfo compare;
! // Get the default comparer instance.
public static CaseInsensitiveComparer Default
{
--- 30,43 ----
public class CaseInsensitiveComparer : IComparer
{
! // The default case insensitive comparer instances.
private static readonly CaseInsensitiveComparer defaultComparer =
new CaseInsensitiveComparer();
+ private static readonly CaseInsensitiveComparer
defaultInvariantComparer =
+ new CaseInsensitiveComparer(CultureInfo.InvariantCulture);
// Internal state.
private CompareInfo compare;
! // Get the default comparer instances.
public static CaseInsensitiveComparer Default
{
***************
*** 43,46 ****
--- 45,55 ----
{
return defaultComparer;
+ }
+ }
+ public static CaseInsensitiveComparer DefaultInvariant
+ {
+ get
+ {
+ return defaultInvariantComparer;
}
}
Index: CaseInsensitiveHashCodeProvider.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/CaseInsensitiveHashCodeProvider.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** CaseInsensitiveHashCodeProvider.cs 13 Dec 2001 05:26:29 -0000 1.1
--- CaseInsensitiveHashCodeProvider.cs 23 Apr 2003 05:39:48 -0000 1.2
***************
*** 3,7 ****
* "System.Collections.CaseInsensitiveHashCodeProvider"
class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 3,7 ----
* "System.Collections.CaseInsensitiveHashCodeProvider"
class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 30,41 ****
public class CaseInsensitiveHashCodeProvider : IHashCodeProvider
{
! // The default case insensitive comparer instance.
! private static readonly CaseInsensitiveHashCodeProvider defaultProvider
=
! new CaseInsensitiveHashCodeProvider();
// Internal state.
private TextInfo info;
! // Get the default comparer instance.
public static CaseInsensitiveHashCodeProvider Default
{
--- 30,45 ----
public class CaseInsensitiveHashCodeProvider : IHashCodeProvider
{
! // The default case insensitive comparer instances.
! private static readonly CaseInsensitiveHashCodeProvider
! defaultProvider =
! new CaseInsensitiveHashCodeProvider();
! private static readonly CaseInsensitiveHashCodeProvider
! defaultInvariantProvider =
! new
CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture);
// Internal state.
private TextInfo info;
! // Get the default comparer instances.
public static CaseInsensitiveHashCodeProvider Default
{
***************
*** 43,46 ****
--- 47,57 ----
{
return defaultProvider;
+ }
+ }
+ public static CaseInsensitiveHashCodeProvider DefaultInvariant
+ {
+ get
+ {
+ return defaultInvariantProvider;
}
}
Index: Comparer.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/Comparer.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Comparer.cs 28 Nov 2001 04:22:39 -0000 1.3
--- Comparer.cs 23 Apr 2003 05:39:48 -0000 1.4
***************
*** 2,6 ****
* Comparer.cs - Implementation of the "System.Collections.Comparer" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* Comparer.cs - Implementation of the "System.Collections.Comparer" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 23,31 ****
using System;
public sealed class Comparer : IComparer
{
! // Default comparer.
public static readonly Comparer Default = new Comparer();
// Private constructor for the default comparer.
--- 23,36 ----
using System;
+ using System.Globalization;
public sealed class Comparer : IComparer
{
! // Default comparers.
public static readonly Comparer Default = new Comparer();
+ #if !ECMA_COMPAT
+ public static readonly Comparer DefaultInvariant
+ = new Comparer(CultureInfo.InvariantCulture);
+ #endif
// Private constructor for the default comparer.
***************
*** 35,38 ****
--- 40,58 ----
}
+ #if !ECMA_COMPAT
+ // Internal state.
+ private CompareInfo info;
+
+ // Public constructor for a culture-based comparer.
+ public Comparer(CultureInfo culture)
+ {
+ if(culture == null)
+ {
+ throw new ArgumentNullException("culture");
+ }
+ this.info = culture.CompareInfo;
+ }
+ #endif
+
// Implement the IComparer interface.
public int Compare(Object a, Object b)
***************
*** 41,44 ****
--- 61,70 ----
if(a != null && b != null)
{
+ #if !ECMA_COMPAT
+ if(info != null && a is String && b is String)
+ {
+ return info.Compare((String)a, (String)b);
+ }
+ #endif
cmp = (a as IComparable);
if(cmp != null)
Index: DictionaryBase.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/DictionaryBase.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** DictionaryBase.cs 14 Dec 2001 09:58:00 -0000 1.1
--- DictionaryBase.cs 23 Apr 2003 05:39:48 -0000 1.2
***************
*** 64,68 ****
return table.Contains(key);
}
! IDictionaryEnumerator IDictionary.GetEnumerator()
{
return ((IDictionary)table).GetEnumerator();
--- 64,68 ----
return table.Contains(key);
}
! public IDictionaryEnumerator GetEnumerator()
{
return ((IDictionary)table).GetEnumerator();
***************
*** 165,169 ****
// Implement the IEnumerable interface.
! public IEnumerator GetEnumerator()
{
return ((IEnumerable)table).GetEnumerator();
--- 165,169 ----
// Implement the IEnumerable interface.
! IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable)table).GetEnumerator();
***************
*** 191,195 ****
protected virtual void OnClear() {}
protected virtual void OnClearComplete() {}
! protected virtual void OnGet(Object key, Object currentValue) {}
protected virtual void OnInsert(Object key, Object value) {}
protected virtual void OnInsertComplete(Object key, Object value) {}
--- 191,198 ----
protected virtual void OnClear() {}
protected virtual void OnClearComplete() {}
! protected virtual Object OnGet(Object key, Object currentValue)
! {
! return currentValue;
! }
protected virtual void OnInsert(Object key, Object value) {}
protected virtual void OnInsertComplete(Object key, Object value) {}
Index: Hashtable.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/Hashtable.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** Hashtable.cs 5 Apr 2003 04:57:05 -0000 1.8
--- Hashtable.cs 23 Apr 2003 05:39:48 -0000 1.9
***************
*** 3,7 ****
* "System.Collections.Hashtable" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 3,7 ----
* "System.Collections.Hashtable" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 26,31 ****
--- 26,35 ----
using System.Private;
using System.Runtime.CompilerServices;
+ using System.Runtime.Serialization;
public class Hashtable : ICloneable, ICollection, IDictionary, IEnumerable
+ #if !ECMA_COMPAT
+ , ISerializable, IDeserializationCallback
+ #endif
{
***************
*** 382,385 ****
--- 386,394 ----
}
}
+ [TODO]
+ protected Hashtable(SerializationInfo info, StreamingContext context)
+ {
+ // TODO
+ }
#endif // !ECMA_COMPAT
***************
*** 831,834 ****
--- 840,862 ----
}
+ #if !ECMA_COMPAT
+
+ // Get the serialization data for this object.
+ [TODO]
+ public virtual void GetObjectData(SerializationInfo info,
+
StreamingContext context)
+ {
+ // TODO
+ }
+
+ // Process a deserialization callback.
+ [TODO]
+ public virtual void OnDeserialization(Object sender)
+ {
+ // TODO
+ }
+
+ #endif // !ECMA_COMPAT
+
// Determine if an item is equal to a key value.
protected virtual bool KeyEquals(Object item, Object key)
***************
*** 880,884 ****
// Get the hash code provider that is being used by this instance.
! protected virtual IHashCodeProvider hcp
{
get
--- 908,912 ----
// Get the hash code provider that is being used by this instance.
! protected IHashCodeProvider hcp
{
get
***************
*** 889,893 ****
// Get the comparer that is being used by this instance.
! protected virtual IComparer comparer
{
get
--- 917,921 ----
// Get the comparer that is being used by this instance.
! protected IComparer comparer
{
get
***************
*** 919,922 ****
--- 947,959 ----
this.table = table;
}
+ #if !ECMA_COMPAT
+ [TODO]
+ internal SynchronizedHashtable(SerializationInfo info,
+
StreamingContext context)
+ : base(info, context)
+ {
+ // TODO
+ }
+ #endif
// Implement the ICloneable interface.
***************
*** 1106,1140 ****
#if !ECMA_COMPAT
! // Get the hash code provider that is being used by this
instance.
! protected override IHashCodeProvider hcp
{
! get
! {
! // We don't lock this because
it does not modify
! // the underlying hash table,
or access fields
! // that may be modified by
other threads.
! return table.hcp;
! }
}
! // Get the comparer that is being used by this instance.
! protected override IComparer comparer
{
! get
! {
! // we do lock this because the
comparer might
! // be set by another thread
! lock(SyncRoot)
! {
! return table.comparer;
! }
! }
! set
! {
! lock(SyncRoot)
! {
! table.comparer = value;
! }
! }
}
--- 1143,1158 ----
#if !ECMA_COMPAT
! // Get the serialization data for this object.
! [TODO]
! public override void GetObjectData(SerializationInfo info,
!
StreamingContext context)
{
! // TODO
}
! // Process a deserialization callback.
! public override void OnDeserialization(Object sender)
{
! // Nothing to do here for synchronized
hash tables.
}
Index: IEnumerable.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/IEnumerable.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** IEnumerable.cs 12 Oct 2001 05:39:56 -0000 1.2
--- IEnumerable.cs 23 Apr 2003 05:39:48 -0000 1.3
***************
*** 3,7 ****
* "System.Collections.IEnumerable" interface.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 3,7 ----
* "System.Collections.IEnumerable" interface.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 24,31 ****
--- 24,38 ----
using System;
+ using System.Runtime.InteropServices;
+ #if !ECMA_COMPAT
+ [Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")]
+ #endif
public interface IEnumerable
{
+ #if !ECMA_COMPAT
+ [DispId(-4)]
+ #endif
IEnumerator GetEnumerator();
Index: IEnumerator.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/IEnumerator.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** IEnumerator.cs 12 Oct 2001 05:39:56 -0000 1.2
--- IEnumerator.cs 23 Apr 2003 05:39:48 -0000 1.3
***************
*** 3,7 ****
* "System.Collections.IEnumerator" interface.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 3,7 ----
* "System.Collections.IEnumerator" interface.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 24,28 ****
--- 24,32 ----
using System;
+ using System.Runtime.InteropServices;
+ #if !ECMA_COMPAT
+ [Guid("496B0ABF-CDEE-11d3-88E8-00902754C43A")]
+ #endif
public interface IEnumerator
{
Index: Queue.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/Queue.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Queue.cs 22 Feb 2003 05:17:08 -0000 1.4
--- Queue.cs 23 Apr 2003 05:39:48 -0000 1.5
***************
*** 2,6 ****
* Queue.cs - Implementation of the "System.Collections.Queue" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* Queue.cs - Implementation of the "System.Collections.Queue" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 170,182 ****
}
- // Determine if this queue is read-only.
- public virtual bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
// Clear the contents of this queue.
public virtual void Clear()
--- 170,173 ----
***************
*** 303,306 ****
--- 294,306 ----
}
+ // Trim this queue to its actual size.
+ public virtual void TrimToSize()
+ {
+ items = ToArray();
+ add = items.Length;
+ remove = 0;
+ size = items.Length;
+ }
+
// Convert this queue into a synchronized queue.
public static Queue Synchronized(Queue queue)
***************
*** 432,435 ****
--- 432,444 ----
{
return queue.ToArray();
+ }
+ }
+
+ // Trim this queue to its actual size.
+ public override void TrimToSize()
+ {
+ lock(SyncRoot)
+ {
+ queue.TrimToSize();
}
}
Index: Stack.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/Stack.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Stack.cs 22 Feb 2003 04:19:28 -0000 1.3
--- Stack.cs 23 Apr 2003 05:39:48 -0000 1.4
***************
*** 2,6 ****
* Stack.cs - Implementation of the "System.Collections.Stack" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* Stack.cs - Implementation of the "System.Collections.Stack" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 129,141 ****
{
return new StackEnumerator(this);
- }
-
- // Determine if this stack is read-only.
- public virtual bool IsReadOnly
- {
- get
- {
- return false;
- }
}
--- 129,132 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Collections ArrayList.cs,1.14,1.15 CaseInsensitiveComparer.cs,1.1,1.2 CaseInsensitiveHashCodeProvider.cs,1.1,1.2 Comparer.cs,1.3,1.4 DictionaryBase.cs,1.1,1.2 Hashtable.cs,1.8,1.9 IEnumerable.cs,1.2,1.3 IEnumerator.cs,1.2,1.3 Queue.cs,1.4,1.5 Stack.cs,1.3,1.4,
Rhys Weatherley <address@hidden> <=