Methods Summary |
---|
public void | addPurchase(java.lang.String product, int quantity, double price)
if (lineItems == null) lineItems = new ArrayList<LineItem>();
LineItem item = new LineItem();
item.setOrder(this);
item.setProduct(product);
item.setQuantity(quantity);
item.setSubtotal(quantity * price);
lineItems.add(item);
total += quantity * price;
|
public int | getId()
return id;
|
public java.util.Collection | getLineItems()
return lineItems;
|
public double | getTotal()
return total;
|
public void | setId(int id)
this.id = id;
|
public void | setLineItems(java.util.Collection lineItems)
this.lineItems = lineItems;
|
public void | setTotal(double total)
this.total = total;
|