//  ===========================================================
//  Hashset is a set of unique elements stored in a hash table
//  based on the hash code of the elements. The hash code is
//  obtained by calling the virtual GetHashCode() member
//  function of the element type.
//  ===========================================================

using System;

namespace System.Collections.Generic
{
    public class HashSet<T> : Enumerable
    {
        public HashSet()
        {
            table = new Hashtable<T, T, Identity<T>>();
        }
        public Enumerator GetEnumerator()
        {
            return table.GetEnumerator();
        }
        public void Clear()
        {
            table.Clear();
        }
        public int Count
        {
            get { return table.Count;}
        }
        public bool Add(T value)
        {
            return table.Add(value);
        }
        public bool Remove(T value)
        {
            return table.Remove(value);
        }
        public bool Contains(T value)
        {
            return table.Contains(value);
        }
        private Hashtable<T, T, Identity<T>> table;
    }
}