KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > calendar > model > Todo


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//limitations under the License.
10
//
11
//The Original Code is "The Columba Project"
12
//
13
//The Initial Developers of the Original Code are Frederik Dietz and Timo
14
// Stich.
15
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16
//
17
//All Rights Reserved.
18
package org.columba.calendar.model;
19
20 import java.net.URL JavaDoc;
21 import java.util.Calendar JavaDoc;
22 import java.util.Iterator JavaDoc;
23
24 import org.columba.calendar.model.api.ITodo;
25
26 public class Todo extends Component implements ITodo {
27
28     private Calendar JavaDoc dtStart;
29
30     private Calendar JavaDoc due;
31
32     private String JavaDoc summary;
33
34     private String JavaDoc description;
35
36     private String JavaDoc priority;
37
38     private String JavaDoc eventClass;
39
40     private URL JavaDoc url;
41
42     private CategoryList categoryList = new CategoryList();
43
44     public Todo(Calendar JavaDoc dtStart, Calendar JavaDoc due, String JavaDoc summary) {
45         super(TYPE.TODO);
46
47         if (dtStart == null)
48             throw new IllegalArgumentException JavaDoc("dtStart == null");
49
50         if (due == null)
51             throw new IllegalArgumentException JavaDoc("due == null");
52
53         if (summary == null)
54             throw new IllegalArgumentException JavaDoc("summary == null");
55
56         this.dtStart = dtStart;
57         this.due = due;
58         this.summary = summary;
59     }
60
61     public Calendar JavaDoc getDue() {
62         return due;
63     }
64
65     public Calendar JavaDoc getDtStart() {
66         return dtStart;
67     }
68
69     public String JavaDoc getPriority() {
70         return priority;
71     }
72
73     public String JavaDoc getSummary() {
74         return summary;
75     }
76
77     public String JavaDoc getDescription() {
78         return description;
79     }
80
81     public URL JavaDoc getUrl() {
82         return url;
83     }
84
85     public String JavaDoc getEventClass() {
86         return eventClass;
87     }
88
89     public void addCategory(String JavaDoc category) {
90         categoryList.addCategory(category);
91     }
92
93     public void removeCategory(String JavaDoc category) {
94         categoryList.removeCategory(category);
95     }
96
97     public Iterator JavaDoc<String JavaDoc> getCategoryIterator() {
98         return categoryList.getCategoryIterator();
99     }
100
101     public String JavaDoc getCategories() {
102         return categoryList.getCategories();
103     }
104
105     public void setCategories(String JavaDoc categories) {
106         categoryList.setCategories(categories);
107     }
108
109 }
110
Popular Tags