KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > samples > bidbuy > LineItem


1 package samples.bidbuy;
2
3 import java.math.BigDecimal JavaDoc;
4
5 public class LineItem {
6
7     // constructors
8

9     public LineItem() {};
10
11     public LineItem(String JavaDoc name, int quantity, BigDecimal JavaDoc price) {
12          this.name=name;
13          this.quantity=quantity;
14          this.price=price;
15     }
16
17     public LineItem(String JavaDoc name, int quantity, String JavaDoc price) {
18          this.name=name;
19          this.quantity=quantity;
20          this.price=new BigDecimal JavaDoc(price);
21     }
22
23     // properties
24

25     private String JavaDoc name;
26     public String JavaDoc getName() { return name; }
27     public void setName(String JavaDoc value) { name=value; }
28
29     private int quantity;
30     public int getQuantity() { return quantity; }
31     public void setQuantity(int value) { quantity=value; }
32
33     private BigDecimal JavaDoc price;
34     public BigDecimal JavaDoc getPrice() { return price; }
35     public void setPrice(BigDecimal JavaDoc value) { price=value; }
36
37 }
38
Popular Tags