예제 #1
0
        static void Main(string[] args)
        {
            NameRepository nameRepository = new NameRepository();

            for (IIterator iterator = nameRepository.GetIterator(); iterator.HasNext();)
            {
                String name = iterator.Next() as String;
                Console.WriteLine("Name: " + name);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            NameRepository nameRepository = new NameRepository();
            IIterator      iter           = nameRepository.Iterator();

            while (iter.HasNext())
            {
                Console.WriteLine((string)iter.Next());
            }
        }
예제 #3
0
        public static void Main(string[] args)
        {
            NameRepository namesRepository = new NameRepository();

            for (Iterator iter = namesRepository.getIterator(); iter.hasNext();)
            {
                string name = (string)iter.next();
                Console.WriteLine("Name : " + name);
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            var namesRepository = new NameRepository();

            for (var iter = namesRepository.GetIterator(); iter.HasNext();)
            {
                var name = iter.Next();
                Console.WriteLine($"Name : {name}");
            }

            Console.ReadKey();
        }
예제 #5
0
 public NameIterator(NameRepository o) => outer = o;