package book;

public class BookshelfRun {

	public static void main(String[] args) {
		Book b1 = new Book("XY1", "title1", 100);
		Book b2 = new Book("XY2", "title2", 134);
		Book b3 = new Book("XY3", "title3", 456);
		Book b4 = new Book("XY4", "title4", 334);
		Book b5 = new Book("XY5", "title5", 665);
		
		// System.out.println(b1);
		
		Bookshelf bookShelf = new Bookshelf();
		bookShelf.addNewBook(b1);
		bookShelf.addNewBook(b2);
		bookShelf.addNewBook(b3);
		bookShelf.addNewBook(b4);
		bookShelf.addNewBook(b5);
		
		for (Book item : bookShelf.getArray()) {
			System.out.println(item);
		}
		
		System.out.println();
		Book[] bookArray = bookShelf.getArray();
		for (int i=0;i<bookArray.length;i++) {
			System.out.println(bookArray[i]);
		}
		
		System.out.println();
		Book[] bookArrayOrderedbyDefault = bookShelf.bookArrayOrderedByDeafult();
		for (int i=0;i<bookArrayOrderedbyDefault.length;i++) {
			System.out.println(bookArrayOrderedbyDefault[i]);
		}
		
		System.out.println();
		Book[] bookArrayOrderedByPrice = bookShelf.bookArrayOrderedByPrice();
		for (int i=0;i<bookArrayOrderedByPrice.length;i++) {
			System.out.println(bookArrayOrderedByPrice[i]);
		}
		
		System.out.println();
		bookShelf.listOrderedByPriceJava8Comp();
		for (Book item : bookShelf.getArray()) {
			System.out.println(item);
		}
		
		System.out.println();
		Book mostExpensive = bookShelf.getMostExpensive();
		System.out.println("The most expensive book: " + mostExpensive);
		
		
		
	}

}
