1 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 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 } 85 | Popular Tags |