namespace pop { using Hashtable = System.Collections.Hashtable; using ICollection = System.Collections.ICollection; using IEnumerator = System.Collections.IEnumerator; using Object = System.Object; using String = System.String; public class PopImpl: Pop { private Hashtable iPop; private IEnumerator iIEnumerator; public PopImpl() { iPop = new Hashtable(); iIEnumerator = null; } public bool Add(Person pPerson) { String tName = pPerson.Name; if (iPop.Contains(tName)) { return false; } iPop.Add(tName, pPerson); return true; } public bool Remove(String pName) { if (iPop.Contains(pName)) { iPop.Remove(pName); return true; } return false; } public Person Get(String pName) { return (Person)iPop[pName]; } public Person GetFirst() { ICollection tICollection = iPop.Values; iIEnumerator = tICollection.GetEnumerator(); return Next(); } public Person Next() { if (iIEnumerator.MoveNext()) { return (Person)iIEnumerator.Current; } return null; } public int Size { get { return iPop.Count; } } public override bool Equals(Object pObject) { PopImpl tPopImpl = (PopImpl)pObject; return iPop.Equals(tPopImpl.iPop); } public override int GetHashCode() { return iPop.GetHashCode(); } public override String ToString() { return iPop.ToString(); } } }