123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
- using System;
- using System.Collections;
- namespace Org.BouncyCastle.Utilities.Collections
- {
- public class HashSet
- : ISet
- {
- private readonly IDictionary impl = Org.BouncyCastle.Utilities.Platform.CreateHashtable();
- public HashSet()
- {
- }
- public HashSet(IEnumerable s)
- {
- foreach (object o in s)
- {
- Add(o);
- }
- }
- public virtual void Add(object o)
- {
- impl[o] = null;
- }
- public virtual void AddAll(IEnumerable e)
- {
- foreach (object o in e)
- {
- Add(o);
- }
- }
- public virtual void Clear()
- {
- impl.Clear();
- }
- public virtual bool Contains(object o)
- {
- return impl.Contains(o);
- }
- public virtual void CopyTo(Array array, int index)
- {
- impl.Keys.CopyTo(array, index);
- }
- public virtual int Count
- {
- get { return impl.Count; }
- }
- public virtual IEnumerator GetEnumerator()
- {
- return impl.Keys.GetEnumerator();
- }
- public virtual bool IsEmpty
- {
- get { return impl.Count == 0; }
- }
- public virtual bool IsFixedSize
- {
- get { return impl.IsFixedSize; }
- }
- public virtual bool IsReadOnly
- {
- get { return impl.IsReadOnly; }
- }
- public virtual bool IsSynchronized
- {
- get { return impl.IsSynchronized; }
- }
- public virtual void Remove(object o)
- {
- impl.Remove(o);
- }
- public virtual void RemoveAll(IEnumerable e)
- {
- foreach (object o in e)
- {
- Remove(o);
- }
- }
- public virtual object SyncRoot
- {
- get { return impl.SyncRoot; }
- }
- }
- }
- #endif
|