1 16 17 package com.tctest.spring.bean; 18 19 20 import java.util.ArrayList ; 21 import java.util.Collection ; 22 import java.util.HashMap ; 23 import java.util.List ; 24 import java.util.Map ; 25 import java.util.Set ; 26 import java.util.SortedSet ; 27 import java.util.TreeSet ; 28 29 33 public class IndexedTestBean { 34 35 private TestBean[] array; 36 37 private List list; 38 39 private SortedSet sortedSet; 40 41 private Set set; 42 43 private Collection collection; 44 45 private Map 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 (); 71 this.list.add(tb2); 72 this.list.add(tb3); 73 this.set = new TreeSet (); 74 this.set.add(tb6); 75 this.set.add(tb7); 76 this.map = new HashMap (); 77 this.map.put("key1", tb4); 78 this.map.put("key2", tb5); 79 this.map.put("key.3", tb5); 80 List list = new ArrayList (); 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 getList() { 96 return list; 97 } 98 99 public void setList(List list) { 100 this.list = list; 101 } 102 103 public SortedSet getSortedSet() { 104 return sortedSet; 105 } 106 107 public void setSortedSet(SortedSet sortedSet) { 108 this.sortedSet = sortedSet; 109 } 110 111 public Set getSet() { 112 return set; 113 } 114 115 public void setSet(Set set) { 116 this.set = set; 117 } 118 119 public Collection getCollection() { 120 return collection; 121 } 122 123 public void setCollection(Collection collection) { 124 this.collection = collection; 125 } 126 127 public Map getMap() { 128 return map; 129 } 130 131 public void setMap(Map map) { 132 this.map = map; 133 } 134 135 } 136 | Popular Tags |