c# IEnumerable 接口 及IEnumerator的接口

1 public interface IEnumerable 
 2   { 
 3 //IEnumerable只有一个方法,返回可循环访问集合的枚举数。 
 4   IEnumerator GetEnumerator() ; 
 5   } 
 6 public interface IEnumerator 
 7   { 
 8 // 方法 
 9 //移到集合的下一个元素。如果成功则返回为 true;如果超过集合结尾,则返回false。 
10 bool MoveNext(); 
11 // 将集合设置为初始位置,该位置位于集合中第一个元素之前 
12 void Reset(); 
13 // 属性:获取集合中的当前元素 
14 object Current { get; } 
15   } 
16 

posted @ 2014-06-07 17:56  zzg168  阅读(112)  评论(0)    收藏  举报