您的位置:首页 > 其它

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

2009-10-09 10:08 417 查看
序号    名称    虚类    枚举    集合    列表    字典    查询    位置
1    Array    *    *    *    *            System
2    CollectionBase    *    *    *    *            Collections
3    KeyedByTypeCollection<TItem>    *    *T    *T    *T            Generic
4    KeyedCollection<K,TItem>    *    *T    *T    *T            ObjectModel
5    DictionaryBase    *    *    *        *        Collections
6    ReadOnlyCollectionBase    *    *    *                Collections
7    NameObjectCollectionBase    *    *    *                Specialized
8    ArrayList        *    *    *            Collections
9    StringCollection        *    *    *            Specialized
10    List<T>        *T    *T    *T            Generic
11    Collection<T>        *T    *T    *T            ObjectModel
12    ObservableCollection<T>        *T    *T    *T            ObjectModel
13    ReadOnlyCollection<T>        *T    *T    *T            ObjectModel
14    SynchronizedCollection<T>        *T    *T    *T            Generic
15    SynchronizedKeyedCollection<K, T>        *T    *T    *T            Generic
16    SynchronizedReadOnlyCollection<T>        *T    *T    *T            Generic
17    Hashtable        *    *        *        Collections
18    SortedList        *    *        *        Collections
19    ListDictionary        *    *        *        Specialized
20    OrderedDictionary        *    *        *        Specialized
21    HybridDictionary        *    *        *        Specialized
22    Dictionary<K,V>        *T    *T        *T        Generic
23    SortedList<K,V>        *T    *T        *T        Generic
24    SortedDictionary<K,V>        *T    *T        *T        Generic
25    Queue        *    *                Collections
26    Queue<T>        *T    *                Generic
27    Stack        *    *                Collections
28    Stack<T>        *T    *                Generic
29    LinkedList<T>        *T    *T                Generic
30    BitArray        *    *                Collections
31    NameValueCollection        *    *                Specialized
32    NameObjectCollectionBase.KeysCollection        *    *                Specialized
33    Dictionary<K,V>.KeyCollection        *T    *T                Generic
34    Dictionary<K,V>.ValueCollection        *T    *T                Generic
35    SortedDictionary<K,V>.KeyCollection        *T    *T                Generic
36    SortedDictionary<K,V>.ValueCollection        *T    *T                Generic
37    HashSet<T>        *T    T                Generic
38    Lookup<K,TElement>        *T                T    Linq
39    StringDictionary        *                    Specialized


=================

先对上贴作个说明:

=================

*代表仅非泛型接口的实现

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐