Package elements
Class Item
java.lang.Object
elements.Item
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a review to the item.<T> booleanChecks if the item's title matches the specified title and type.getKind()Gets the kind or genre of the item.floatCalculates the mean reviews of the item.Gets the reviews associated with the item.getTitle()Gets the title of the item.intGets 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
-