NoSortHashtable.cs
资源名称:moban.rar [点击查看]
上传用户:szraylite
上传日期:2018-06-06
资源大小:11546k
文件大小:1k
源码类别:
软件测试
开发平台:
Java
- using System;
- using System.Collections;
- namespace ENTERPRISE.DataAccessLayer
- {
- /// <summary>
- /// NoSortHashtable重写Hashtable,使它不排序
- /// ArrayList是不排序,而Hashtable是排序的
- ///
- /// </summary>
- public class NoSortHashtable:Hashtable
- {
- private ArrayList keys = new ArrayList();
- public NoSortHashtable()
- {
- }
- public override void Add(object key, object value)
- {
- base.Add (key, value);
- keys.Add (key);
- }
- public override ICollection Keys
- {
- get
- {
- return keys;
- }
- }
- public override void Clear()
- {
- base.Clear ();
- keys.Clear ();
- }
- public override void Remove(object key)
- {
- base.Remove (key);
- keys.Remove (key);
- }
- public override IDictionaryEnumerator GetEnumerator()
- {
- return base.GetEnumerator ();
- }
- }
- }