01: // The contents of this file are subject to the Mozilla Public License Version
02: // 1.1
03: //(the "License"); you may not use this file except in compliance with the
04: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
05: //
06: //Software distributed under the License is distributed on an "AS IS" basis,
07: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
08: //for the specific language governing rights and
09: //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.util.Calendar;
21:
22: import org.columba.calendar.base.VCalendarUIDGenerator;
23: import org.columba.calendar.model.api.IComponent;
24:
25: public class Component implements IComponent {
26:
27: private String id;
28:
29: private TYPE type;
30:
31: private Calendar dtStamp;
32:
33: private String calendarId;
34:
35: public Component(String id, TYPE type) {
36: if (id == null)
37: throw new IllegalArgumentException("id == null");
38: if (type == null)
39: throw new IllegalArgumentException("type == null");
40:
41: this .id = id;
42: this .type = type;
43:
44: dtStamp = Calendar.getInstance();
45: }
46:
47: public Component(TYPE type) {
48: if (type == null)
49: throw new IllegalArgumentException("type == null");
50:
51: // generate default unique id
52: this .id = new VCalendarUIDGenerator().newUID();
53:
54: this .type = type;
55:
56: dtStamp = Calendar.getInstance();
57:
58: }
59:
60: public TYPE getType() {
61: return type;
62: }
63:
64: public String getId() {
65: return id;
66: }
67:
68: public Calendar getDtStamp() {
69: return dtStamp;
70: }
71:
72: public void setDtStamp(Calendar calendar) {
73: this .dtStamp = calendar;
74: }
75:
76: public String getCalendar() {
77: return calendarId;
78: }
79:
80: public void setCalendar(String calendar) {
81: this.calendarId = calendar;
82: }
83:
84: }
|