1 package sellwin.domain; 2 3 import java.math.*; 4 import java.util.*; 5 import java.io.*; 6 7 11 12 18 public class CustomerInventory implements Serializable { 19 private long pk; 20 private Product product; 21 private Integer cnt; 22 private String modifiedBy; 23 private Date modifiedDate; 24 private boolean addedLocally=false; 25 26 private long customerPK; 29 public CustomerInventory() { 30 product = null; cnt = new Integer (0); 32 modifiedDate = new Date(); 33 customerPK = 0; 34 } 35 36 public CustomerInventory(Product n, Integer ct) { 37 product = n; 38 cnt = ct; 39 } 40 41 public final void setPK(long pk) { this.pk = pk; } 42 public final void setCustomerPK(long pk) { this.customerPK = pk; } 43 public final void setProduct(Product n) { product = n; } 44 public final void setCount(Integer i) { cnt = i; } 45 public final void setModifiedBy(String s) { modifiedBy = s; } 46 public final void setModifiedDate(Date d) { modifiedDate = d; } 47 public final void setAddedLocally(boolean t) { addedLocally = t; } 48 49 public final long getPK() { return pk; } 50 public final long getCustomerPK() { return customerPK; } 51 public final Product getProduct() { return product; } 52 public final Integer getCount() { return cnt; } 53 public final Date getModifiedDate() { return modifiedDate; } 54 public final String getModifiedBy() { return modifiedBy; } 55 public final boolean getAddedLocally() { return addedLocally; } 56 57 public final CustomerInventory copy() { 58 Product copyProd = getProduct().copy(); 59 Integer copyCnt = new Integer (getCount().intValue()); 60 CustomerInventory copy = new CustomerInventory(copyProd, copyCnt); 61 copy.modifiedBy = new String (modifiedBy); 62 copy.modifiedDate = new Date(modifiedDate.getTime()); 63 copy.customerPK = customerPK; 64 return copy; 65 } 66 67 public final void print() { 68 System.out.println("<<Customer Inventory>>"); 69 System.out.println("pk=["+getPK()+"]"); 70 getProduct().print(); 71 System.out.println("Count="+getCount()); 72 System.out.println("ModifiedDate="+getModifiedDate()); 73 System.out.println("ModifiedBy="+getModifiedBy()); 74 } 75 } 76 | Popular Tags |