001: // The contents of this file are subject to the Mozilla Public License Version
002: // 1.1
003: //(the "License"); you may not use this file except in compliance with the
004: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005: //
006: //Software distributed under the License is distributed on an "AS IS" basis,
007: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008: //for the specific language governing rights and
009: //limitations under the License.
010: //
011: //The Original Code is "The Columba Project"
012: //
013: //The Initial Developers of the Original Code are Frederik Dietz and Timo
014: // Stich.
015: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016: //
017: //All Rights Reserved.
018: package org.columba.calendar.model;
019:
020: import java.net.URL;
021: import java.util.Calendar;
022: import java.util.Iterator;
023:
024: import org.columba.calendar.model.api.ITodo;
025:
026: public class Todo extends Component implements ITodo {
027:
028: private Calendar dtStart;
029:
030: private Calendar due;
031:
032: private String summary;
033:
034: private String description;
035:
036: private String priority;
037:
038: private String eventClass;
039:
040: private URL url;
041:
042: private CategoryList categoryList = new CategoryList();
043:
044: public Todo(Calendar dtStart, Calendar due, String summary) {
045: super (TYPE.TODO);
046:
047: if (dtStart == null)
048: throw new IllegalArgumentException("dtStart == null");
049:
050: if (due == null)
051: throw new IllegalArgumentException("due == null");
052:
053: if (summary == null)
054: throw new IllegalArgumentException("summary == null");
055:
056: this .dtStart = dtStart;
057: this .due = due;
058: this .summary = summary;
059: }
060:
061: public Calendar getDue() {
062: return due;
063: }
064:
065: public Calendar getDtStart() {
066: return dtStart;
067: }
068:
069: public String getPriority() {
070: return priority;
071: }
072:
073: public String getSummary() {
074: return summary;
075: }
076:
077: public String getDescription() {
078: return description;
079: }
080:
081: public URL getUrl() {
082: return url;
083: }
084:
085: public String getEventClass() {
086: return eventClass;
087: }
088:
089: public void addCategory(String category) {
090: categoryList.addCategory(category);
091: }
092:
093: public void removeCategory(String category) {
094: categoryList.removeCategory(category);
095: }
096:
097: public Iterator<String> getCategoryIterator() {
098: return categoryList.getCategoryIterator();
099: }
100:
101: public String getCategories() {
102: return categoryList.getCategories();
103: }
104:
105: public void setCategories(String categories) {
106: categoryList.setCategories(categories);
107: }
108:
109: }
|