01: package oes;
02:
03: import java.util.Collection;
04:
05: public class Price {
06:
07: private int _priceId;
08:
09: private double _msrp;
10:
11: private double _cost;
12:
13: private boolean _hasCost;
14:
15: private String _currency;
16:
17: private Collection _discounts;
18:
19: public int getPriceId() {
20: return _priceId;
21: }
22:
23: public void setPriceId(int id) {
24: _priceId = id;
25: }
26:
27: public double getMsrp() {
28: return _msrp;
29: }
30:
31: public void setMsrp(double msrp) {
32: _msrp = msrp;
33: }
34:
35: public double getCost() {
36: return _cost;
37: }
38:
39: public void setCost(double cost) {
40: _cost = cost;
41: _hasCost = true;
42: }
43:
44: public boolean hasCost() {
45: return _hasCost;
46: }
47:
48: public void deleteCost() {
49: _hasCost = false;
50: }
51:
52: public String getCurrency() {
53: return _currency;
54: }
55:
56: public void setCurrency(String currency) {
57: if (currency.length() != 3)
58: throw new IllegalArgumentException(
59: "Argument 'currency' is three letters");
60: _currency = currency;
61: }
62:
63: public Collection getDiscounts() {
64: return _discounts;
65: }
66:
67: public Discount createDiscount() {
68: return new Discount();
69: }
70:
71: }
|