xlawrence 2004/12/08 17:03:49 CET
Modified files:
src/java/org/jahia/suite/calendar/framework/model
Calendar.java
Log:
Added getter for a particluar event
Revision Changes Path
1.3 +16 -1
uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/model/Calendar.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/model/Calendar.java.diff?r1=1.2&r2=1.3&f=h
Index: Calendar.java
===================================================================
RCS file:
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/framework/model/Calendar.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Calendar.java 22 Nov 2004 10:58:35 -0000 1.2
+++ Calendar.java 8 Dec 2004 16:03:49 -0000 1.3
@@ -68,6 +68,21 @@
}
/**
+ * Returns the event identified by the given key
+ * @param key The key of the event to retrieve
+ * @return The corresponding SyncEvent object or NULL if not found
+ */
+ public SyncEvent getEvent(String key) {
+ for (int i=0; i<events.length; i++) {
+ SyncEvent e = events[i];
+ if (e.getKey().equals(key)) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ /**
* Adds a synchronizable event to this Calendar Object
* @param event The event to add
*/
@@ -111,7 +126,7 @@
}
public String toString() {
- StringBuffer buff = new StringBuffer("\n");
+ StringBuffer buff = new StringBuffer();
for (int i=0; i<events.length; i++) {
buff.append(events[i].toString()+'\n');
}