Package elements
Class Item
java.lang.Object
elements.Item
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a review to the item.<T> boolean
Checks if the item's title matches the specified title and type.getKind()
Gets the kind or genre of the item.float
Calculates the mean reviews of the item.Gets the reviews associated with the item.getTitle()
Gets the title of the item.int
Gets the number of reviews for the item.
-
Constructor Details
-
Item
-
-
Method Details
-
addReview
-
nbReviews
public int nbReviews()Gets the number of reviews for the item.- Returns:
- the number of reviews for the item
-
equals
Checks if the item's title matches the specified title and type.- Type Parameters:
T
- the type of the item- Parameters:
title
- the title to comparetype
- the type of the item (e.g., ItemBook.class, ItemFilm.class)- Returns:
- true if the titles match and the item is of the specified type, false otherwise
-
getMeanReviews
public float getMeanReviews()Calculates the mean reviews of the item.- Returns:
- the mean reviews of the item
-
getTitle
-
getKind
-
getReviews
-