01: package wingscms;
02:
03: /**
04: * ShoppingCartItem
05: *
06: * @author Christian Fetzer
07: */
08: public class ShoppingCartItem {
09:
10: final private Product product;
11: private int amount = 1;
12:
13: public Product getProduct() {
14: return this .product;
15: }
16:
17: public int getAmount() {
18: return this .amount;
19: }
20:
21: public void setAmount(int amount) {
22: this .amount = amount;
23: }
24:
25: public ShoppingCartItem(Product product) {
26: this .product = product;
27: }
28:
29: public double getAllRoundPrice() {
30: return amount * getProduct().getPrice();
31: }
32: }
|