KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > StockDetail


1 package org.apache.ojb.broker;
2
3 public class StockDetail implements java.io.Serializable JavaDoc
4 {
5
6     protected boolean isSelloutArticle;
7
8     protected int minimumStock;
9
10     protected int orderedUnits;
11
12     protected int stock;
13
14     protected String JavaDoc unit;
15
16     private ArticleWithStockDetail myArticle;
17
18     public StockDetail()
19     {
20         
21     }
22
23     public StockDetail(boolean sellout, int minimum, int ordered, int stock, String JavaDoc unit, ArticleWithStockDetail parent)
24     {
25         isSelloutArticle = sellout;
26         minimumStock = minimum;
27         orderedUnits = ordered;
28         this.stock = stock;
29         this.unit = unit;
30         myArticle = parent;
31     }
32
33
34     public int getStock()
35     {
36         return stock;
37     }
38
39     public void setStock(int newStock)
40     {
41         stock = newStock;
42         // we must keep the detail object in sync with the parent:
43
if (myArticle != null)
44         {
45             myArticle.stock = newStock;
46         }
47     }
48     /**
49      * Returns the isSelloutArticle.
50      * @return boolean
51      */

52     public boolean isSelloutArticle()
53     {
54         return isSelloutArticle;
55     }
56
57     /**
58      * Returns the minimumStock.
59      * @return int
60      */

61     public int getMinimumStock()
62     {
63         return minimumStock;
64     }
65
66     /**
67      * Returns the myArticle.
68      * @return ArticleWithStockDetail
69      */

70     public ArticleWithStockDetail getMyArticle()
71     {
72         return myArticle;
73     }
74
75     /**
76      * Returns the orderedUnits.
77      * @return int
78      */

79     public int getOrderedUnits()
80     {
81         return orderedUnits;
82     }
83
84     /**
85      * Returns the unit.
86      * @return String
87      */

88     public String JavaDoc getUnit()
89     {
90         return unit;
91     }
92
93     /**
94      * Sets the isSelloutArticle.
95      * @param isSelloutArticle The isSelloutArticle to set
96      */

97     public void setIsSelloutArticle(boolean isSelloutArticle)
98     {
99         this.isSelloutArticle = isSelloutArticle;
100     }
101
102     /**
103      * Sets the minimumStock.
104      * @param minimumStock The minimumStock to set
105      */

106     public void setMinimumStock(int minimumStock)
107     {
108         this.minimumStock = minimumStock;
109     }
110
111     /**
112      * Sets the myArticle.
113      * @param myArticle The myArticle to set
114      */

115     public void setMyArticle(ArticleWithStockDetail myArticle)
116     {
117         this.myArticle = myArticle;
118     }
119
120     /**
121      * Sets the orderedUnits.
122      * @param orderedUnits The orderedUnits to set
123      */

124     public void setOrderedUnits(int orderedUnits)
125     {
126         this.orderedUnits = orderedUnits;
127     }
128
129     /**
130      * Sets the unit.
131      * @param unit The unit to set
132      */

133     public void setUnit(String JavaDoc unit)
134     {
135         this.unit = unit;
136     }
137
138 }
139
Popular Tags