예제 #1
0
        //------
        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);
        }
예제 #2
0
        public KidData(string filename)
        {
            kids  = new ArrayList();
            clubs = new Hashtable();
            csFile fl = new csFile(filename);

            fl.OpenForRead();
            string line = fl.readLine();

            while (line != null)
            {
                Kid    kd   = new Kid(line);
                string club = kd.getClub();
                if (!clubs.Contains(club))
                {
                    clubs.Add(club, club);
                }
                kids.Add(kd);
                line = fl.readLine();
            }
            fl.close();
            index = 0;
        }