📄 cartitem.java
字号:
package com.publish.shop.order.javabeans;import java.math.*;import com.publish.shop.order.javabeans.ItemInfo;public class CartItem { private ItemInfo item; private int quantity; private boolean inStock; private BigDecimal total; public CartItem(){ quantity = 0; } public ItemInfo getItem() { return item; } public void setItem(ItemInfo item) { this.item = item; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public boolean getInStock() { return inStock; } public void setInStock(boolean inStock) { this.inStock = inStock; } public BigDecimal getTotal() { return total; } public void setTotal(BigDecimal total) { this.total = total; } private void calcTotal() { if (item != null && item.getListPrice()!=null) { total = item.getListPrice().multiply(new BigDecimal(quantity)); } else { total = null; } } public void increaseQuantity() { quantity++; calcTotal(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -