1 17 18 19 package org.apache.commons.betwixt.examples.rss; 20 21 import java.io.Serializable ; 22 import java.util.ArrayList ; 23 import java.util.List ; 24 25 26 37 38 public class Channel implements Serializable { 39 40 41 43 44 47 protected ArrayList items = new ArrayList (); 48 49 50 53 protected ArrayList skipDays = new ArrayList (); 54 55 56 59 protected ArrayList skipHours = new ArrayList (); 60 61 62 64 65 68 protected String copyright = null; 69 70 public String getCopyright() { 71 if (this.copyright == null) { 72 return "Public Domain"; 73 } else { 74 return (this.copyright); 75 } 76 } 77 78 public void setCopyright(String copyright) { 79 this.copyright = copyright; 80 } 81 82 83 86 protected String description = null; 87 88 public String getDescription() { 89 return (this.description); 90 } 91 92 public void setDescription(String description) { 93 this.description = description; 94 } 95 96 97 100 protected String docs = null; 101 102 public String getDocs() { 103 return (this.docs); 104 } 105 106 public void setDocs(String docs) { 107 this.docs = docs; 108 } 109 110 111 114 protected Image image = null; 115 116 public Image getImage() { 117 return (this.image); 118 } 119 120 public void setImage(Image image) { 121 this.image = image; 122 } 123 124 125 128 protected String language = null; 129 130 public String getLanguage() { 131 return (this.language); 132 } 133 134 public void setLanguage(String language) { 135 this.language = language; 136 } 137 138 139 142 protected String lastBuildDate = null; 143 144 public String getLastBuildDate() { 145 return (this.lastBuildDate); 146 } 147 148 public void setLastBuildDate(String lastBuildDate) { 149 this.lastBuildDate = lastBuildDate; 150 } 151 152 153 156 protected String link = null; 157 158 public String getLink() { 159 return (this.link); 160 } 161 162 public void setLink(String link) { 163 this.link = link; 164 } 165 166 167 170 protected String managingEditor = null; 171 172 public String getManagingEditor() { 173 return (this.managingEditor); 174 } 175 176 public void setManagingEditor(String managingEditor) { 177 this.managingEditor = managingEditor; 178 } 179 180 181 184 protected String pubDate = null; 185 186 public String getPubDate() { 187 return (this.pubDate); 188 } 189 190 public void setPubDate(String pubDate) { 191 this.pubDate = pubDate; 192 } 193 194 195 198 protected String rating = null; 199 200 public String getRating() { 201 return (this.rating); 202 } 203 204 public void setRating(String rating) { 205 this.rating = rating; 206 } 207 208 209 212 protected TextInput textInput = null; 213 214 public TextInput getTextInput() { 215 return (this.textInput); 216 } 217 218 public void setTextInput(TextInput textInput) { 219 this.textInput = textInput; 220 } 221 222 223 226 protected String title = null; 227 228 public String getTitle() { 229 return (this.title); 230 } 231 232 public void setTitle(String title) { 233 this.title = title; 234 } 235 236 237 240 protected double version = 0.91; 241 242 public double getVersion() { 243 return (this.version); 244 } 245 246 public void setVersion(double version) { 247 this.version = version; 248 } 249 250 251 254 protected String webMaster = null; 255 256 public String getWebMaster() { 257 return (this.webMaster); 258 } 259 260 public void setWebMaster(String webMaster) { 261 this.webMaster = webMaster; 262 } 263 264 265 267 268 273 public void addItem(Item item) { 274 synchronized (items) { 275 items.add(item); 276 } 277 } 278 279 280 285 public void addSkipDay(String skipDay) { 286 synchronized (skipDays) { 287 skipDays.add(skipDay); 288 } 289 } 290 291 292 297 public void addSkipHour(String skipHour) { 298 synchronized (skipHours) { 299 skipHours.add(skipHour); 300 } 301 } 302 303 306 public List getItems() { 307 return items; 308 } 309 310 311 314 public String [] findSkipDays() { 315 synchronized (skipDays) { 316 String skipDays[] = new String [this.skipDays.size()]; 317 return ((String []) this.skipDays.toArray(skipDays)); 318 } 319 } 320 321 322 325 public String [] getSkipHours() { 326 return findSkipHours(); 327 } 328 329 330 333 public String [] findSkipHours() { 334 synchronized (skipHours) { 335 String skipHours[] = new String [this.skipHours.size()]; 336 return ((String []) this.skipHours.toArray(skipHours)); 337 } 338 } 339 340 341 344 public String [] getSkipDays() { 345 return findSkipDays(); 346 } 347 348 349 354 public void removeItem(Item item) { 355 synchronized (items) { 356 items.remove(item); 357 } 358 } 359 360 361 366 public void removeSkipDay(String skipDay) { 367 synchronized (skipDays) { 368 skipDays.remove(skipDay); 369 } 370 } 371 372 373 378 public void removeSkipHour(String skipHour) { 379 synchronized (skipHours) { 380 skipHours.remove(skipHour); 381 } 382 } 383 } 384 | Popular Tags |