コード例 #1
0
        static void Main(string[] args)
        {
            Iterator        iterator;
            IListCollection list = new ConcreteList();

            iterator = list.GetIterator();

            while (iterator.MoveNext())
            {
                int i = (int)iterator.GetCurrent();
                Console.WriteLine(i.ToString());
                iterator.Next();
            }

            Console.ReadLine();
        }
コード例 #2
0
        public ConcreteIterator(ConcreteList list)
        {
            this.list = list;

            index = 0;
        }
コード例 #3
0
 public ConcreteIterator(ConcreteList list)
 {
     _list  = list;
     _index = 0;
 }