1 package org.columba.calendar.model; 19 20 import org.columba.calendar.base.UUIDGenerator; 21 import org.columba.calendar.model.api.IEvent; 22 import org.columba.calendar.model.api.IEventInfo; 23 import org.columba.calendar.model.api.IComponent.TYPE; 24 25 public class EventInfo extends ComponentInfo implements IEventInfo { 26 27 private IEvent event; 28 29 public EventInfo(String id, String calendarId, IEvent event) { 30 super(id, TYPE.EVENT, calendarId, event); 31 this.event = event; 32 } 33 34 public IEvent getEvent() { 35 return event; 36 } 37 38 41 @Override 42 protected Object clone() throws CloneNotSupportedException { 43 44 String newId = new UUIDGenerator().newUUID(); 46 47 Event newEvent = new Event(newId); 48 newEvent.setDtStart(getEvent().getDtStart()); 50 newEvent.setDtEnd(getEvent().getDtEnd()); 51 newEvent.setDtStamp(getEvent().getDtStamp()); 52 newEvent.setSummary(getEvent().getSummary()); 53 newEvent.setLocation(getEvent().getLocation()); 54 newEvent.setCalendar(getCalendar()); 55 56 EventInfo eventInfo = new EventInfo(newId, getCalendar(), newEvent); 57 58 return eventInfo; 59 } 60 61 64 public IEventInfo createCopy() { 65 try { 66 return (IEventInfo) clone(); 67 } catch (CloneNotSupportedException e) { 68 } 69 return null; 70 } 71 72 } 73 | Popular Tags |