Package elements
Class ItemBook
java.lang.Object
elements.Item
elements.ItemBook
Represents a book item in the social network. Inherits from the Item class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the author of the book.int
Gets the number of pages in the book.toString()
Returns a string representation of the book item.Methods inherited from class elements.Item
addReview, equals, getKind, getMeanReviews, getReviews, getTitle, nbReviews
-
Constructor Details
-
ItemBook
public ItemBook(String title, String kind, String author, int nbPages) throws exceptions.BadEntryException Constructs a new ItemBook with the specified title, kind, author, and number of pages.- Parameters:
title
- the title of the bookkind
- the kind or genre of the bookauthor
- the author of the booknbPages
- the number of pages in the book- Throws:
exceptions.BadEntryException
- if any of the parameters are invalid
-
-
Method Details
-
getAuthor
-
getNbPages
public int getNbPages()Gets the number of pages in the book.- Returns:
- the number of pages in the book
-
toString
-