KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > test > DummyBean


1 package fr.improve.struts.taglib.layout.test;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.Date JavaDoc;
5 import java.util.List JavaDoc;
6
7 /**
8  * @author JN RIBETTE
9  *
10  * A dummy bean used in the test / examples.
11  */

12 public class DummyBean {
13     private String JavaDoc string1;
14     private String JavaDoc string2;
15     private Date JavaDoc date1;
16     private int int1;
17     private double double1;
18     /**
19      * Returns the date1.
20      * @return Date
21      */

22     public Date JavaDoc getDate1() {
23         return date1;
24     }
25
26     /**
27      * Returns the int1.
28      * @return int
29      */

30     public int getInt1() {
31         return int1;
32     }
33
34     /**
35      * Returns the string1.
36      * @return String
37      */

38     public String JavaDoc getString1() {
39         return string1;
40     }
41
42     /**
43      * Returns the string2.
44      * @return String
45      */

46     public String JavaDoc getString2() {
47         return string2;
48     }
49
50     /**
51      * Sets the date1.
52      * @param date1 The date1 to set
53      */

54     public void setDate1(Date JavaDoc date1) {
55         this.date1 = date1;
56     }
57
58     /**
59      * Sets the int1.
60      * @param int1 The int1 to set
61      */

62     public void setInt1(int int1) {
63         this.int1 = int1;
64     }
65
66     /**
67      * Sets the string1.
68      * @param string1 The string1 to set
69      */

70     public void setString1(String JavaDoc string1) {
71         this.string1 = string1;
72     }
73
74     /**
75      * Sets the string2.
76      * @param string2 The string2 to set
77      */

78     public void setString2(String JavaDoc string2) {
79         this.string2 = string2;
80     }
81     /**
82      * Returns the double1.
83      * @return double
84      */

85     public double getDouble1() {
86         return double1;
87     }
88
89     /**
90      * Sets the double1.
91      * @param double1 The double1 to set
92      */

93     public void setDouble1(double double1) {
94         this.double1 = double1;
95     }
96     public static List JavaDoc getList() {
97         List JavaDoc lc_list = new ArrayList JavaDoc();
98         DummyBean lc_bean = new DummyBean();
99         lc_bean.setString1("Jacques");
100         lc_bean.setString2("Dupond");
101         lc_bean.setDate1(new Date JavaDoc());
102         lc_bean.setInt1(45);
103         lc_bean.setDouble1(45.78);
104         lc_list.add(lc_bean);
105         
106         lc_bean = new DummyBean();
107         lc_bean.setString1("John");
108         lc_bean.setString2("Smith");
109         lc_bean.setDate1(new Date JavaDoc(4560568));
110         lc_bean.setInt1(128);
111         lc_bean.setDouble1(5.468);
112         lc_list.add(lc_bean);
113         
114         lc_bean = new DummyBean();
115         lc_bean.setString1("Mike");
116         lc_bean.setString2("Turner");
117         lc_bean.setDate1(new Date JavaDoc(1204578));
118         lc_bean.setInt1(87);
119         lc_bean.setDouble1(5.9);
120         lc_list.add(lc_bean);
121
122         lc_bean = new DummyBean();
123         lc_bean.setString1("Pierre");
124         lc_bean.setString2("Durand");
125         lc_bean.setDate1(new Date JavaDoc(78560568));
126         lc_bean.setInt1(50);
127         lc_bean.setDouble1(-8.8);
128         lc_list.add(lc_bean);
129         return lc_list;
130     }
131
132 }
133
Popular Tags