UnityMol  0.9.6-875
UnityMol viewer / In developement
HashSet.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections;
3 
4 namespace BenTools.Data
5 {
9  public class HashSet : IEnumerable, ICollection
10  {
11  Hashtable H = new Hashtable();
12  object Dummy = new object();
13  public HashSet(){}
14  public void Add(object O)
15  {
16  H[O] = Dummy;
17  }
18  public void AddRange(IEnumerable List)
19  {
20  foreach(object O in List)
21  Add(O);
22  }
23  public void Remove(object O)
24  {
25  H.Remove(O);
26  }
27  public bool Contains(object O)
28  {
29  return H.ContainsKey(O);
30  }
31  public void Clear()
32  {
33  H.Clear();
34  }
35  public IEnumerator GetEnumerator()
36  {
37  return H.Keys.GetEnumerator();
38  }
39  public int Count
40  {
41  get
42  {
43  return H.Count;
44  }
45  }
46 
47  public bool IsSynchronized
48  {
49  get
50  {
51  return H.IsSynchronized;
52  }
53  }
54 
55  public void CopyTo(Array array, int index)
56  {
57  H.Keys.CopyTo(array,index);
58  }
59 
60  public object SyncRoot
61  {
62  get
63  {
64  return H.SyncRoot;
65  }
66  }
67  }
68 }
void Remove(object O)
Definition: HashSet.cs:23
void AddRange(IEnumerable List)
Definition: HashSet.cs:18
IEnumerator GetEnumerator()
Definition: HashSet.cs:35
bool Contains(object O)
Definition: HashSet.cs:27
Summary description for Hashset.
Definition: HashSet.cs:9
void Add(object O)
Definition: HashSet.cs:14
void CopyTo(Array array, int index)
Definition: HashSet.cs:55