Package com.jahnreil_stratpoint.model
Class CartItem
java.lang.Object
com.jahnreil_stratpoint.model.CartItem
The CartItem class represents an item in the shopping cart.
It holds a reference to a Product, the quantity of the product, and the total price.
The CartItem must be constructed with all arguments.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCalculates the total price for the CartItem based on the product price and quantity.
-
Constructor Details
-
CartItem
public CartItem()
-
-
Method Details
-
calculateTotal
Calculates the total price for the CartItem based on the product price and quantity. The totalPrice is reset to 0 before recalculating.- Returns:
- the total price of the CartItem
-