KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > archive > history > HistoryRecord


1 /*
2  * Created on Jul 2, 2006
3  */

4 package com.openedit.archive.history;
5
6 import java.util.HashMap JavaDoc;
7 import java.util.Iterator JavaDoc;
8 import java.util.Map JavaDoc;
9
10 import org.apache.commons.collections.map.ListOrderedMap;
11
12 import com.openedit.store.Product;
13
14 public class HistoryRecord
15 {
16     protected Product fieldProduct;
17     protected Map JavaDoc fieldData;
18     protected String JavaDoc fieldId;
19     
20     public String JavaDoc getId()
21     {
22         return fieldId;
23     }
24
25     public void setId(String JavaDoc inId)
26     {
27         fieldId = inId;
28     }
29
30     public Product getProduct()
31     {
32         return fieldProduct;
33     }
34
35     public void setProduct(Product inProduct)
36     {
37         fieldProduct = inProduct;
38     }
39
40     public void putData(String JavaDoc inId, String JavaDoc inVal)
41     {
42         getData().put(inId, inVal);
43     }
44
45     public Map JavaDoc getData()
46     {
47         if (fieldData == null)
48         {
49             fieldData = ListOrderedMap.decorate(new HashMap JavaDoc());
50         }
51         return fieldData;
52     }
53
54     public Iterator JavaDoc getIdIterator()
55     {
56         return getData().keySet().iterator();
57     }
58
59     public String JavaDoc get(String JavaDoc inId)
60     {
61         return (String JavaDoc)getData().get(inId);
62     }
63     
64 }
65
Popular Tags