Exemplo n.º 1
0
        static void Main(string[] args)
        {
            NameRepository namesRepository = new NameRepository();

            for (IIterator iter = namesRepository.GetIterator(); iter.HasNext();)
            {
                String name = (String)iter.Next();
                Console.WriteLine("Name : " + name);
                Console.ReadKey();
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            NameRepository namesRepository = new NameRepository();

            IIterator iter = namesRepository.GetIterator();

            while (iter.HasNext())
            {
                string name = (string)iter.Next();
                Console.WriteLine("Name : " + name);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var namesRepository = new NameRepository();

            for (IIterator iter = namesRepository.getIterator(); iter.hasNext();)
            {
                var name = iter.next().ToString();
                Console.WriteLine($"Name: {name}");
            }

            Console.ReadLine();
        }
Exemplo n.º 4
0
        public static void Demo()
        {
            NameRepository nr = new NameRepository();

            //NameRepository.NameIterator ni = new NameRepository.NameIterator();
            for (Iterator i = nr.GetIterator(); i.HasNext();)
            {
                Console.WriteLine(i.Next());
            }

            Console.ReadLine();
        }
Exemplo n.º 5
0
 public NameIterator(NameRepository _nameRepository)
 {
     nameRepository = _nameRepository;
 }