1 18 package org.objectweb.speedo.pobjects.collection; 19 20 import java.util.Collection ; 21 import java.util.Set ; 22 import java.util.List ; 23 import java.util.HashSet ; 24 import java.util.ArrayList ; 25 import java.util.Vector ; 26 import java.util.LinkedList ; 27 28 32 public class AllCollection { 33 34 private String id; 35 36 private Collection col_Long; 37 private Collection col_ref; 38 39 private Set set_Long; 40 private Set set_ref; 41 private HashSet hset_Long; 42 private HashSet hset_ref; 43 44 private List list_Long; 45 private List list_ref; 46 private ArrayList arraylist_Long; 47 private ArrayList arraylist_String; 48 private ArrayList arraylist_ref; 49 private Vector vector_Long; 50 private Vector vector_ref; 51 private LinkedList ll_Long; 52 private LinkedList ll_ref; 53 54 public AllCollection() { 55 } 56 57 public AllCollection(String id) { 58 this.id = id; 59 } 60 61 public String getId() { 62 return id; 63 } 64 65 public void setLongs(long[] ls) { 66 if (ls == null) { 67 col_Long = null; 68 set_Long = null; 69 list_Long = null; 70 hset_Long = null; 71 arraylist_Long = null; 72 vector_Long = null; 73 ll_Long = null; 74 } else { 75 col_Long = new ArrayList (); 76 set_Long = new HashSet (); 77 list_Long = new ArrayList (); 78 hset_Long = new HashSet (); 79 arraylist_Long = new ArrayList (); 80 arraylist_String = new ArrayList (); 81 vector_Long = new Vector (); 82 ll_Long = new LinkedList (); 83 addAll(ls); 84 } 85 } 86 87 public void addAll(long[] ls) { 88 for(int i=0; i<ls.length; i++) { 89 Long l = new Long (ls[i]); 90 if (col_Long != null) { 91 col_Long.add(l); 92 } 93 if (set_Long != null) { 94 set_Long.add(l); 95 } 96 if (list_Long != null) { 97 list_Long.add(l); 98 } 99 if (hset_Long != null) { 100 hset_Long.add(l); 101 } 102 if (arraylist_Long != null) { 103 arraylist_Long.add(l); 104 } 105 if (arraylist_String != null) { 106 arraylist_String.add(""+l); 107 } 108 if (vector_Long != null) { 109 vector_Long.add(l); 110 } 111 if (ll_Long != null) { 112 ll_Long.add(l); 113 } 114 } 115 116 } 117 118 public void setRefs(Object [] os) { 119 if (os == null) { 120 col_ref = null; 121 set_ref = null; 122 list_ref = null; 123 hset_ref = null; 124 arraylist_ref = null; 125 vector_ref = null; 126 ll_ref = null; 127 } else { 128 col_ref = new ArrayList (); 129 set_ref = new HashSet (); 130 list_ref = new ArrayList (); 131 hset_ref = new HashSet (); 132 arraylist_ref = new ArrayList (); 133 vector_ref = new Vector (); 134 ll_ref = new LinkedList (); 135 for(int i=0; i<os.length; i++) { 136 col_ref.add(os[i]); 137 set_ref.add(os[i]); 138 list_ref.add(os[i]); 139 hset_ref.add(os[i]); 140 arraylist_ref.add(os[i]); 141 vector_ref.add(os[i]); 142 ll_ref.add(os[i]); 143 } 144 } 145 } 146 147 148 public Collection getCol_Long() { 149 return col_Long; 150 } 151 152 public Collection getCol_ref() { 153 return col_ref; 154 } 155 156 public Set getSet_Long() { 157 return set_Long; 158 } 159 160 public Set getSet_ref() { 161 return set_ref; 162 } 163 164 public List getList_Long() { 165 return list_Long; 166 } 167 168 public List getList_ref() { 169 return list_ref; 170 } 171 172 public HashSet getHset_Long() { 173 return hset_Long; 174 } 175 176 public HashSet getHset_ref() { 177 return hset_ref; 178 } 179 180 public ArrayList getArraylist_Long() { 181 return arraylist_Long; 182 } 183 184 public ArrayList getArraylist_String() { 185 return arraylist_String; 186 } 187 188 public ArrayList getArraylist_ref() { 189 return arraylist_ref; 190 } 191 192 public Vector getVector_Long() { 193 return vector_Long; 194 } 195 196 public Vector getVector_ref() { 197 return vector_ref; 198 } 199 200 public LinkedList getLl_Long() { 201 return ll_Long; 202 } 203 204 public LinkedList getLl_ref() { 205 return ll_ref; 206 } 207 } 208 | Popular Tags |