KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > spring > bean > IndexedTestBean


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package com.tctest.spring.bean;
18
19
20 import java.util.ArrayList JavaDoc;
21 import java.util.Collection JavaDoc;
22 import java.util.HashMap JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.Map JavaDoc;
25 import java.util.Set JavaDoc;
26 import java.util.SortedSet JavaDoc;
27 import java.util.TreeSet JavaDoc;
28
29 /**
30  * @author Juergen Hoeller
31  * @since 11.11.2003
32  */

33 public class IndexedTestBean {
34
35     private TestBean[] array;
36
37     private List JavaDoc list;
38
39     private SortedSet JavaDoc sortedSet;
40
41     private Set JavaDoc set;
42
43     private Collection JavaDoc collection;
44
45     private Map JavaDoc map;
46
47
48     public IndexedTestBean() {
49         this(true);
50     }
51
52     public IndexedTestBean(boolean populate) {
53         if (populate) {
54             populate();
55         }
56     }
57
58     public void populate() {
59         TestBean tb0 = new TestBean("name0", 0);
60         TestBean tb1 = new TestBean("name1", 0);
61         TestBean tb2 = new TestBean("name2", 0);
62         TestBean tb3 = new TestBean("name3", 0);
63         TestBean tb4 = new TestBean("name4", 0);
64         TestBean tb5 = new TestBean("name5", 0);
65         TestBean tb6 = new TestBean("name6", 0);
66         TestBean tb7 = new TestBean("name7", 0);
67         TestBean tbX = new TestBean("nameX", 0);
68         TestBean tbY = new TestBean("nameY", 0);
69         this.array = new TestBean[] {tb0, tb1};
70         this.list = new ArrayList JavaDoc();
71         this.list.add(tb2);
72         this.list.add(tb3);
73         this.set = new TreeSet JavaDoc();
74         this.set.add(tb6);
75         this.set.add(tb7);
76         this.map = new HashMap JavaDoc();
77         this.map.put("key1", tb4);
78         this.map.put("key2", tb5);
79         this.map.put("key.3", tb5);
80         List JavaDoc list = new ArrayList JavaDoc();
81         list.add(tbX);
82         list.add(tbY);
83         this.map.put("key4", list);
84     }
85
86
87     public TestBean[] getArray() {
88         return array;
89     }
90
91     public void setArray(TestBean[] array) {
92         this.array = array;
93     }
94
95     public List JavaDoc getList() {
96         return list;
97     }
98
99     public void setList(List JavaDoc list) {
100         this.list = list;
101     }
102
103     public SortedSet JavaDoc getSortedSet() {
104         return sortedSet;
105     }
106
107     public void setSortedSet(SortedSet JavaDoc sortedSet) {
108         this.sortedSet = sortedSet;
109     }
110
111     public Set JavaDoc getSet() {
112         return set;
113     }
114
115     public void setSet(Set JavaDoc set) {
116         this.set = set;
117     }
118
119     public Collection JavaDoc getCollection() {
120         return collection;
121     }
122
123     public void setCollection(Collection JavaDoc collection) {
124         this.collection = collection;
125     }
126
127     public Map JavaDoc getMap() {
128         return map;
129     }
130
131     public void setMap(Map JavaDoc map) {
132         this.map = map;
133     }
134
135 }
136
Popular Tags