コード例 #1
0
        private void init()
        {
            kdata = new KidData("50free.txt");
            KidIterator kiter = kdata.getIterator();

            while (kiter.MoveNext())
            {
                Kid kd = (Kid)kiter.Current;
                lsKids.Items.Add(kd.getFrname() + " " + kd.getLname());
            }
            IDictionaryEnumerator clubiter = kdata.getClubs();

            while (clubiter.MoveNext())
            {
                cbClubs.Items.Add((string)clubiter.Value);
            }
        }
コード例 #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;
        }
コード例 #3
0
 //-----
 public bool compare(Kid kd, int key)
 {
     return(compareTo(getData(key), kd.getData(key)));
 }