2 using System
.Collections
;
6 namespace SemWeb
.Util
{
8 internal class ResSet
: ICollection
{
9 Hashtable items
= new Hashtable();
15 private ResSet(Hashtable items
) {
19 public void Add(Resource res
) {
23 public void Remove(Resource res
) {
28 public bool Contains(Resource res
) {
29 return items
.ContainsKey(res
);
32 public ICollection Items
{
40 public void AddRange(ResSet
set) {
41 foreach (Resource r
in set.Items
) {
51 public ResSet
Clone() {
52 return new ResSet((Hashtable
)items
.Clone());
55 public int Count { get { return items.Count; }
}
57 public IEnumerator
GetEnumerator() { return items.Keys.GetEnumerator(); }
59 bool ICollection
.IsSynchronized { get { return false; }
}
60 object ICollection
.SyncRoot { get { return null; }
}
62 public void CopyTo(System
.Array array
, int index
) {
63 foreach (Resource r
in this)
64 array
.SetValue(r
, index
++);
67 /*Hashtable Intersect(Hashtable x, Hashtable y) {
69 if (x.Count < y.Count) { a = x; b = y; }
70 else { b = x; a = y; }
71 Hashtable c = new Hashtable();
72 foreach (Resource r in a)