设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 2051|回复: 1
打印 上一主题 下一主题

【原创】所有集合类型整理(注:由于BitVector32未实现枚举接口,不计入)

[复制链接]
跳转到指定楼层
1#
发表于 2014-2-25 09:11:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. 序号    名称    虚类    枚举    集合    列表    字典    查询    位置
  2. 1    Array    *    *    *    *            System
  3. 2    CollectionBase    *    *    *    *            Collections
  4. 3    KeyedByTypeCollection<TItem>    *    *T    *T    *T            Generic
  5. 4    KeyedCollection<K,TItem>    *    *T    *T    *T            ObjectModel
  6. 5    DictionaryBase    *    *    *        *        Collections
  7. 6    ReadOnlyCollectionBase    *    *    *                Collections
  8. 7    NameObjectCollectionBase    *    *    *                Specialized
  9. 8    ArrayList        *    *    *            Collections
  10. 9    StringCollection        *    *    *            Specialized
  11. 10    List<T>        *T    *T    *T            Generic
  12. 11    Collection<T>        *T    *T    *T            ObjectModel
  13. 12    ObservableCollection<T>        *T    *T    *T            ObjectModel
  14. 13    ReadOnlyCollection<T>        *T    *T    *T            ObjectModel
  15. 14    SynchronizedCollection<T>        *T    *T    *T            Generic
  16. 15    SynchronizedKeyedCollection<K, T>        *T    *T    *T            Generic
  17. 16    SynchronizedReadOnlyCollection<T>        *T    *T    *T            Generic
  18. 17    Hashtable        *    *        *        Collections
  19. 18    SortedList        *    *        *        Collections
  20. 19    ListDictionary        *    *        *        Specialized
  21. 20    OrderedDictionary        *    *        *        Specialized
  22. 21    HybridDictionary        *    *        *        Specialized
  23. 22    Dictionary<K,V>        *T    *T        *T        Generic
  24. 23    SortedList<K,V>        *T    *T        *T        Generic
  25. 24    SortedDictionary<K,V>        *T    *T        *T        Generic
  26. 25    Queue        *    *                Collections
  27. 26    Queue<T>        *T    *                Generic
  28. 27    Stack        *    *                Collections
  29. 28    Stack<T>        *T    *                Generic
  30. 29    LinkedList<T>        *T    *T                Generic
  31. 30    BitArray        *    *                Collections
  32. 31    NameValueCollection        *    *                Specialized
  33. 32    NameObjectCollectionBase.KeysCollection        *    *                Specialized
  34. 33    Dictionary<K,V>.KeyCollection        *T    *T                Generic
  35. 34    Dictionary<K,V>.ValueCollection        *T    *T                Generic
  36. 35    SortedDictionary<K,V>.KeyCollection        *T    *T                Generic
  37. 36    SortedDictionary<K,V>.ValueCollection        *T    *T                Generic
  38. 37    HashSet<T>        *T    T                Generic
  39. 38    Lookup<K,TElement>        *T                T    Linq
  40. 39    StringDictionary        *                    Specialized
复制代码


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
 楼主| 发表于 2014-2-25 09:11:44 | 只看该作者
=================
先对上贴作个说明:
=================
*代表仅非泛型接口的实现
T代表非泛型和泛型接口同时实现
t代表仅泛型接口的时实现
[x]代表abstract类型

========
关系图谱
========
IList        --       
                +-->ICollection  -->Ienumerable
IDictionary  --               //
                                      |
Ilist <>            --                        |   
                +-->Icollection <>-->Ienumerable <>
Idictionary <>--    ILookup <>       
        
========
进化过程
========         
枚举-->集合-->(列表/字典)

*有兴趣的可以看一下《C#核心技术》这本书书,算是介绍的比较详细了。

发现网上关于集合问的比较多,但是没有答清楚的一个问题:
是List <T>与Collection <T>的区别是什么?
Collection <T>实现了List <T>的功能,
区别在于Collection可以当作基类,重载以下四个方法和一个属性,
以便对元素进行控制,而List只能进行枚举。
System.Collections.ObjectModel.Collection <T>.ClearItems()
System.Collections.ObjectModel.Collection <T>.InsertItem(int, T)
System.Collections.ObjectModel.Collection <T>.RemoveItem(int)
System.Collections.ObjectModel.Collection <T>.SetItem(int, T)
System.Collections.ObjectModel.Collection <T>.Items
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-3 07:35 , Processed in 0.087491 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表