|
using System;
using System.Collections;
namespace Voronoi.Data
{
/// <summary>
/// Summary description for Hashset.
/// </summary>
public class HashSet : IEnumerable, ICollection
{
Hashtable H = new Hashtable();
object Dummy = new object();
public HashSet(){}
public void Add(object O)
{
H[O] = Dummy;
}
public void AddRange(IEnumerable List)
{
foreach(object O in List)
Add(O);
}
public void Remove(object O)
{
H.Remove(O);
}
public bool Contains(object O)
{
return H.ContainsKey(O);
}
public void Clear()
{
H.Clear();
}
public IEnumerator GetEnumerator()
{
return H.Keys.GetEnumerator();
}
public int Count
{
get
{
return H.Count;
}
}
public bool IsSynchronized
{
get
{
return H.IsSynchronized;
}
}
public void CopyTo(Array array, int index)
{
H.Keys.CopyTo(array,index);
}
public object SyncRoot
{
get
{
return H.SyncRoot;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.