Esempio n. 1
0
        static void Main(string[] args)
        {
            var bookShelf = new BookShelf();

            bookShelf.AppendBook(new Book("Around the World in 80 Days"));
            bookShelf.AppendBook(new Book("Bible"));
            bookShelf.AppendBook(new Book("Cinderella"));
            bookShelf.AppendBook(new Book("Daddy-Long-Legs"));

            var iterator = bookShelf.Iterator();

            while (iterator.HasNext())
            {
                var book = (Book)iterator.Next();
                Console.WriteLine(book.Name);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            BookShelf bookShelf = new BookShelf();

            bookShelf.AppendBook(new Book("Around the world in 80 days"));
            bookShelf.AppendBook(new Book("Bigle"));
            bookShelf.AppendBook(new Book("Cinderella"));
            bookShelf.AppendBook(new Book("Daddy-Long-legs"));
            IIterator it = bookShelf.Iterator();

            while (it.HasNext())
            {
                Book book = (Book)it.Next();
                Console.WriteLine(book.GetName());
            }

            // 入力待ち
            Console.ReadLine();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            BookShelf bookShelf = new BookShelf(4);

            bookShelf.AppendBook(new Book("Around the World in 80 Days"));
            bookShelf.AppendBook(new Book("Bible"));
            bookShelf.AppendBook(new Book("Cinderella"));
            bookShelf.AppendBook(new Book("Daddy-Long-Legs"));
            bookShelf.AppendBook(new Book("Manchi"));
            bookShelf.AppendBook(new Book("Reference Book"));
            IIterator it = bookShelf.Iterator();

            while (it.HasNext())
            {
                Book book = (Book)it.Next();
                Console.WriteLine(book.GetName());
            }
            // Console.WriteLine("Hello World!");
        }