?? filterediter.cs
字號:
using System;
using System.Collections ;
namespace FileredIterator
{
/// <summary>
/// Summary description for KidIterator.
/// </summary>
public class FilteredIterator : IEnumerator {
private ArrayList kids;
private int index;
private string club;
public FilteredIterator(ArrayList kidz, string club) {
kids = kidz;
index = 0;
this.club = club;
}
//------
public bool MoveNext() {
bool more = index < kids.Count-1 ;
if(more) {
Kid kd = (Kid)kids[++index];
more = index < kids.Count;
while(more && ! kd.getClub().Equals (club)) {
kd = (Kid)kids[index++];
more = index < kids.Count ;
}
}
return more;
}
//------
public object Current {
get {
return kids[index];
}
}
//------
public void Reset() {
index = 0;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -