더북(TheBook)

        if (booksByFilter.contains("publisher")) {             
             for (int j = 0; j < filter.get("publisher").size(); j++) { 
                String publisherName = filter.get("publisher").get(j); 
                for (int i = 0; i < listOfBooks.size(); i++) {
                    Book book = listOfBooks.get(i); 

                    if (publisherName.equalsIgnoreCase(book.getPublisher()))
                        booksByPublisher.add(book);
                }
            }
        }

 

        if (booksByFilter.contains("category")) {
             for (int i = 0; i < filter.get("category").size(); i++) { 
                String category = filter.get("category").get(i); 
                List<Book> list = getBookListByCategory(category); 
                booksByCategory.addAll(list); 
            }
        }

 

        booksByCategory.retainAll(booksByPublisher); 
        return booksByCategory;
    }

}
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.