1 20 21 package golfShop.data.item; 22 23 import java.util.Vector ; 24 import java.util.Enumeration ; 25 26 27 33 public class ItemDO implements java.io.Serializable 34 { 35 36 38 private static ItemStore storage = null; 39 40 41 43 44 47 48 49 public static void InitializeStorageOption(String opt,String dir) 50 { 51 try 52 { 53 if (opt.equalsIgnoreCase("memory")) 54 { 55 storage = new ItemStoreMemory(); 56 storage.initializeItemStore(); 57 } 58 else if (opt.equalsIgnoreCase("file")) 59 { 60 storage = new ItemStoreFile(); 61 storage.initializeItemStore(dir); 62 } 63 else 64 { 65 storage = new ItemStoreMemory(); 66 storage.initializeItemStore(); 67 } 68 } catch (Exception e) 69 { 70 } 71 72 73 } 74 75 76 77 78 81 protected ItemDO(long objectid, String SKU, double price, 82 String name, String desc) 83 { 84 85 this.objectid = objectid; 86 this.SKU = SKU; 87 this.price = price; 88 this.name = name; 89 this.desc = desc; 90 } 91 92 94 97 public static ItemDO getItemByObjectId(long objectId) 98 { 99 100 return(storage.findItemInStore(objectId)); 101 } 102 103 104 106 private long objectid ; private String SKU ; private double price ; private String name ; private String desc ; 112 113 115 116 public long getObjectId() 117 { 118 return this.objectid; 119 } 120 protected void setObjectId(long newId) 122 { 123 this.objectid = newId; 124 } 125 126 public String getSKU() 127 { 128 return this.SKU; 129 } 130 public void setSKU(String newSKU) 131 { 132 this.SKU = newSKU; 133 } 134 135 public double getPrice() 136 { 137 return this.price; 138 } 139 public void setPrice(double newPrice) 140 { 141 this.price = newPrice; 142 } 143 144 public String getName() 145 { 146 return this.name; 147 } 148 public void setName(String newName) 149 { 150 this.desc = newName; 151 } 152 153 public String getDescription() 154 { 155 return this.desc; 156 } 157 public void setDescription(String newDesc) 158 { 159 this.desc = newDesc; 160 } 161 162 163 165 } 166 | Popular Tags |