1 package org.apache.ojb.broker; 2 3 6 public abstract class AbstractArticle implements InterfaceArticle, java.io.Serializable 7 { 8 9 10 public String toString() 11 { 12 String groupId = "" + productGroupId; 13 String groupName = productGroup != null ? productGroup.getName() : null; 14 15 return "----\n" + 16 "Article No: " + articleId + "\n" + 17 "Description: " + articleName + "\n" + 18 "ProductGroupId: " + groupId + "\n" + 19 "ProductGroupName: " + groupName + "\n" + 20 "stock: " + stock + "\n" + 21 "price: " + price + "\n" + 22 "stock-value " + getStockValue() + "\n"; 23 24 } 25 26 27 protected Integer articleId; 28 29 protected String articleName; 30 31 42 protected boolean isSelloutArticle; 43 44 protected int minimumStock; 45 46 protected int orderedUnits; 47 48 protected double price; 49 50 protected InterfaceProductGroup productGroup; 51 52 protected Integer productGroupId; 53 54 protected int stock; 55 56 protected int supplierId; 57 58 protected String unit; 59 60 64 public AbstractArticle() 65 { 66 } 67 68 72 public Integer getArticleId() 73 { 74 return articleId; 75 } 76 77 81 public void setArticleId(Integer newArticleId) 82 { 83 articleId = newArticleId; 84 } 85 86 public void setProductGroup(InterfaceProductGroup newProductGroup) 87 { 88 productGroup = newProductGroup; 89 } 90 91 public void setProductGroupId(Integer newProductGroupId) 92 { 93 productGroupId = newProductGroupId; 94 } 95 96 public InterfaceProductGroup getProductGroup() 97 { 98 return productGroup; 99 } 100 101 public Integer getProductGroupId() 102 { 103 return productGroupId; 104 } 105 106 107 public void addToStock(int diff) 108 { 109 stock += diff; 110 } 111 112 116 public String getArticleName() 117 { 118 return articleName; 119 } 120 121 122 123 public double getStockValue() 124 { 125 return price * stock; 126 } 127 128 132 public void setArticleName(java.lang.String newArticleName) 133 { 134 articleName = newArticleName; 135 } 136 137 142 public boolean getIsSelloutArticle() 143 { 144 return isSelloutArticle; 145 } 146 147 152 public int getMinimumStock() 153 { 154 return minimumStock; 155 } 156 157 162 public int getOrderedUnits() 163 { 164 return orderedUnits; 165 } 166 167 172 public double getPrice() 173 { 174 return price; 175 } 176 177 182 public int getStock() 183 { 184 return stock; 185 } 186 187 192 public int getSupplierId() 193 { 194 return supplierId; 195 } 196 197 202 public java.lang.String getUnit() 203 { 204 return unit; 205 } 206 207 212 public void setIsSelloutArticle(boolean newIsSelloutArticle) 213 { 214 isSelloutArticle = newIsSelloutArticle; 215 } 216 217 222 public void setMinimumStock(int newMinimumStock) 223 { 224 minimumStock = newMinimumStock; 225 } 226 227 232 public void setOrderedUnits(int newOrderedUnits) 233 { 234 orderedUnits = newOrderedUnits; 235 } 236 237 242 public void setPrice(double newPrice) 243 { 244 price = newPrice; 245 } 246 247 252 public void setStock(int newStock) 253 { 254 stock = newStock; 255 } 256 257 262 public void setSupplierId(int newSupplierId) 263 { 264 supplierId = newSupplierId; 265 } 266 267 272 public void setUnit(java.lang.String newUnit) 273 { 274 unit = newUnit; 275 } 276 } 277 | Popular Tags |