System.Collections 学习中。。。
来源:互联网 发布:手机号码绑定的软件 编辑:程序博客网 时间:2024/06/04 19:15
手边没笔记本,这篇blog纯粹是读书笔记 (持续更新笔记)
namespace System.Collecitons 下面有四个基本接口:
1. IEnumerable : 迭代借口 方法有:GetEnumerator , 继承此接口 就可以用foreach 了
2. ICollection: 继承了IEnumerable 接口。方法有 GetEnumerator ,CopyTo
3. IList: 继承了IEnumerable 和 ICollection 接口。 方法比较多,不写了。 基本是描述了一个线性数据结构,
4. IDictionary 继承了IEnumerable 和 ICollection 接口。
有个Abstract 类叫CollectionBase, 继承了IEnumerable ICollection 和 IList 接口。 基本上
有个Abstract 类叫DictionaryBase, 继承了IDictionary 接口。
上面这两个是用来给我们开发自己的集合类用的,要是需要更加底层的封装自己的集合类,那就要用那4个接口了。
其他像是Array Arraylist List Hashtable Dictoinary Stack Queue, 就是最上层的封装了,直接给用户用的。
IEnumerable 的泛型IEnumerable<T> 可以供Linq 里的 Where 和 Select 用,用来过滤数据,这是一种避免for loop方法
C#里shallow copy 有现成的方法,MemberWiseClone(), ,深拷贝就得自己写啦;
下面这个图是essential C#里的
- System.Collections 学习中。。。
- C#学习之System.Collections.Generic 与 System.Collections 记录
- Java中Collections学习
- C++ Builder中使用System.Generics.Collections
- System.Collections
- System.Collections、System.Collections.Generic、System.Collections.Specialized
- System.Collections中字典的介绍及其工作原理
- System.Collections中的内容
- The System.Collections Namespace
- System.Collections.ArrayList
- System.Collections.Specialized namespace
- System.Collections 命名空间
- System.Collections命名空间
- System.Collections命名空间
- System.Collections.ArrayList用法
- System.Collections.ArrayList(一)
- System.Collections.ArrayList(二)
- System.Collections命名空间
- 联合主键映射
- java.lang.IllegalArgumentException
- yum的详细使用方法
- B KB GB MB ..转换
- hibernate开发步骤
- System.Collections 学习中。。。
- Manifest文件
- 如何在MyEclipse8.5中更改servlet模板 .
- 收藏搬家了
- 初识MMU
- Objective-C 入门
- java转发和重定向
- mac acrobat xi破解
- PreEmptive的VS TFS源码分析软件PATFS如何设置新数据检查间隔