FileDocCategorySizeDatePackage
Order.javaAPI DocJBoss 4.2.12652Fri Jul 13 20:55:24 BST 2007org.jboss.tutorial.entity.bean

Order

public class Order extends Object implements Serializable

Fields Summary
private int
id
private double
total
private Collection
lineItems
Constructors Summary
Methods Summary
public voidaddPurchase(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 intgetId()

      return id;
   
public java.util.CollectiongetLineItems()

      return lineItems;
   
public doublegetTotal()

      return total;
   
public voidsetId(int id)

      this.id = id;
   
public voidsetLineItems(java.util.Collection lineItems)

      this.lineItems = lineItems;
   
public voidsetTotal(double total)

      this.total = total;