[Bedework-commit] calendarapi r594 - in trunk: annotations/resources
annotations/src/org/bedework/calfacade/annotations
calFacade/src/org/bedework/calfacade
calFacade/src/org/bedework/calfacade/base
calFacade/src/org/bedework/calfacade/util
calFacade/src/org/bedework/calfacade/wrappers
calsvc/src/org/bedework/calsvc
svnadmin at bedework.org
svnadmin at bedework.org
Sun Apr 20 00:39:16 EDT 2008
Author: douglm
Date: 2008-04-20 00:38:53 -0400 (Sun, 20 Apr 2008)
New Revision: 594
Added:
trunk/calFacade/src/org/bedework/calfacade/base/OverrideList.java
trunk/calFacade/src/org/bedework/calfacade/base/OverrideSet.java
Modified:
trunk/annotations/resources/BwEventProxy.java.rsrc
trunk/annotations/src/org/bedework/calfacade/annotations/ProcessState.java
trunk/annotations/src/org/bedework/calfacade/annotations/ProxyHandler.java
trunk/calFacade/src/org/bedework/calfacade/BwAlarm.java
trunk/calFacade/src/org/bedework/calfacade/BwCalendar.java
trunk/calFacade/src/org/bedework/calfacade/BwEvent.java
trunk/calFacade/src/org/bedework/calfacade/BwEventObj.java
trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java
trunk/calFacade/src/org/bedework/calfacade/BwFilterDef.java
trunk/calFacade/src/org/bedework/calfacade/BwVenue.java
trunk/calFacade/src/org/bedework/calfacade/base/AlarmsEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/AttachmentsEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/AttendeesEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/CategorisedEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/CommentedEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/ContactedEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/DescriptionEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/OverrideCollection.java
trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/ResourcedEntity.java
trunk/calFacade/src/org/bedework/calfacade/base/SummaryEntity.java
trunk/calFacade/src/org/bedework/calfacade/util/ChangeTable.java
trunk/calFacade/src/org/bedework/calfacade/wrappers/CalendarWrapper.java
trunk/calsvc/src/org/bedework/calsvc/Scheduling.java
Log:
Use Set and List instead of Collection to more closely match the hibernate definitions and standard ical usage.
A little closer to using annotations to produce the proxy and annotation classes
Modified: trunk/annotations/resources/BwEventProxy.java.rsrc
===================================================================
--- trunk/annotations/resources/BwEventProxy.java.rsrc 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/annotations/resources/BwEventProxy.java.rsrc 2008-04-20 04:38:53 UTC (rev 594)
@@ -25,12 +25,13 @@
*/
package org.bedework.calfacade;
-import org.bedework.calfacade.base.OverrideCollection;
+import org.bedework.calfacade.base.OverrideList;
+import org.bedework.calfacade.base.OverrideSet;
import org.bedework.calfacade.exc.CalFacadeException;
import org.bedework.calfacade.util.CalFacadeUtil;
-import java.util.Collection;
-import java.util.TreeSet;
+import java.util.List;
+import java.util.Set;
/** An event proxy in Bedework.If an event is an alias or reference to another
* event, this class holds links to both. The referring event will hold user
Modified: trunk/annotations/src/org/bedework/calfacade/annotations/ProcessState.java
===================================================================
--- trunk/annotations/src/org/bedework/calfacade/annotations/ProcessState.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/annotations/src/org/bedework/calfacade/annotations/ProcessState.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -117,7 +117,12 @@
return false;
}
- return tm.toString().startsWith("java.util.Collection"); // Must be a better way
+ /* XXX There must be a better way than this */
+ String typeStr = tm.toString();
+
+ return typeStr.startsWith("java.util.Collection") ||
+ typeStr.startsWith("java.util.List") ||
+ typeStr.startsWith("java.util.Set");
}
/**
Modified: trunk/annotations/src/org/bedework/calfacade/annotations/ProxyHandler.java
===================================================================
--- trunk/annotations/src/org/bedework/calfacade/annotations/ProxyHandler.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/annotations/src/org/bedework/calfacade/annotations/ProxyHandler.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -66,8 +66,7 @@
*/
public boolean startProxy(AnnotationProcessorEnvironment env) {
try {
- proxyRdr = new LineNumberReader(
- new FileReader(pstate.resourcePath + "/" +
+ proxyRdr = new LineNumberReader(new FileReader(pstate.resourcePath + "/" +
proxyTemplateName));
proxyOut = env.getFiler().createSourceFile("org.bedework.calfacade." +
@@ -260,16 +259,6 @@
proxyOut.print(" public ");
proxyOut.print(returnTypeStr);
- proxyOut.println(" getEmptyOverrideCollection() {");
- proxyOut.print(" return new TreeSet<");
- proxyOut.print(typePar);
- proxyOut.println(">();");
- proxyOut.println(" }");
-
- proxyOut.println("");
-
- proxyOut.print(" public ");
- proxyOut.print(returnTypeStr);
proxyOut.println(" getMasterCollection() {");
proxyOut.print(" return getTarget().");
proxyOut.print(methName);
Modified: trunk/calFacade/src/org/bedework/calfacade/BwAlarm.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwAlarm.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwAlarm.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -68,8 +68,8 @@
import net.fortuna.ical4j.model.property.Trigger;
import java.io.Serializable;
-import java.util.Collection;
import java.util.Date;
+import java.util.Set;
import java.util.TreeSet;
/** An alarm in bedework representing an rfc2445 valarm object.
@@ -118,11 +118,11 @@
protected String attach;
- private Collection<BwString> summaries;
+ private Set<BwString> summaries;
- private Collection<BwString> descriptions;
+ private Set<BwString> descriptions;
- protected Collection<BwAttendee> attendees;
+ protected Set<BwAttendee> attendees;
/* ------------------------- Non-db fields ---------------------------- */
@@ -153,7 +153,7 @@
* @param attach String audio file or attachment or exec
* @param description String description
* @param summary String summary (email)
- * @param attendees Collection of attendees
+ * @param attendees Set of attendees
* @throws CalFacadeException
*/
public BwAlarm(BwEvent event,
@@ -171,7 +171,7 @@
String attach,
String description,
String summary,
- Collection<BwAttendee> attendees) throws CalFacadeException {
+ Set<BwAttendee> attendees) throws CalFacadeException {
super(owner, false);
setEvent(event);
this.alarmType = alarmType;
@@ -421,18 +421,18 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.AttendeesEntity#setAttendees(java.util.Collection)
+ * @see org.bedework.calfacade.base.AttendeesEntity#setAttendees(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.ATTENDEE,
alarmProperty = true)
- public void setAttendees(Collection<BwAttendee> val) {
+ public void setAttendees(Set<BwAttendee> val) {
attendees = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AttendeesEntity#getAttendees()
*/
- public Collection<BwAttendee> getAttendees() {
+ public Set<BwAttendee> getAttendees() {
return attendees;
}
@@ -440,7 +440,7 @@
* @see org.bedework.calfacade.base.AttendeesEntity#getNumAttendees()
*/
public int getNumAttendees() {
- Collection<BwAttendee> as = getAttendees();
+ Set<BwAttendee> as = getAttendees();
if (as == null) {
return 0;
}
@@ -452,7 +452,7 @@
* @see org.bedework.calfacade.base.AttendeesEntity#addAttendee(org.bedework.calfacade.BwAttendee)
*/
public void addAttendee(BwAttendee val) {
- Collection<BwAttendee> as = getAttendees();
+ Set<BwAttendee> as = getAttendees();
if (as == null) {
as = new TreeSet<BwAttendee>();
setAttendees(as);
@@ -467,7 +467,7 @@
* @see org.bedework.calfacade.base.AttendeesEntity#removeAttendee(org.bedework.calfacade.BwAttendee)
*/
public boolean removeAttendee(BwAttendee val) {
- Collection<BwAttendee> as = getAttendees();
+ Set<BwAttendee> as = getAttendees();
if (as == null) {
return false;
}
@@ -478,7 +478,7 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AttendeesEntity#copyAttendees()
*/
- public Collection<BwAttendee> copyAttendees() {
+ public Set<BwAttendee> copyAttendees() {
if (getNumAttendees() == 0) {
return null;
}
@@ -494,7 +494,7 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AttendeesEntity#cloneAttendees()
*/
- public Collection<BwAttendee> cloneAttendees() {
+ public Set<BwAttendee> cloneAttendees() {
if (getNumAttendees() == 0) {
return null;
}
@@ -508,15 +508,15 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.AttendeesEntity#setRecipients(java.util.Collection)
+ * @see org.bedework.calfacade.base.AttendeesEntity#setRecipients(java.util.Set)
*/
- public void setRecipients(Collection<String> val) {
+ public void setRecipients(Set<String> val) {
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AttendeesEntity#getRecipients()
*/
- public Collection<String> getRecipients() {
+ public Set<String> getRecipients() {
return null;
}
@@ -545,18 +545,18 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Collection)
+ * @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.DESCRIPTION,
alarmProperty = true)
- public void setDescriptions(Collection<BwString> val) {
+ public void setDescriptions(Set<BwString> val) {
descriptions = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.DescriptionEntity#getDescriptions()
*/
- public Collection<BwString> getDescriptions() {
+ public Set<BwString> getDescriptions() {
return descriptions;
}
@@ -564,7 +564,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#getNumDescriptions()
*/
public int getNumDescriptions() {
- Collection<BwString> rs = getDescriptions();
+ Set<BwString> rs = getDescriptions();
if (rs == null) {
return 0;
}
@@ -583,7 +583,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#addDescription(org.bedework.calfacade.BwString)
*/
public void addDescription(BwString val) {
- Collection<BwString> rs = getDescriptions();
+ Set<BwString> rs = getDescriptions();
if (rs == null) {
rs = new TreeSet<BwString>();
setDescriptions(rs);
@@ -598,7 +598,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#removeDescription(org.bedework.calfacade.BwString)
*/
public boolean removeDescription(BwString val) {
- Collection<BwString> rs = getDescriptions();
+ Set<BwString> rs = getDescriptions();
if (rs == null) {
return false;
}
@@ -657,16 +657,16 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.SummaryEntity#setSummaries(java.util.Collection)
+ * @see org.bedework.calfacade.base.SummaryEntity#setSummaries(java.util.Set)
*/
- public void setSummaries(Collection<BwString> val) {
+ public void setSummaries(Set<BwString> val) {
summaries = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.SummaryEntity#getSummaries()
*/
- public Collection<BwString> getSummaries() {
+ public Set<BwString> getSummaries() {
return summaries;
}
@@ -674,7 +674,7 @@
* @see org.bedework.calfacade.base.SummaryEntity#getNumSummaries()
*/
public int getNumSummaries() {
- Collection<BwString> rs = getSummaries();
+ Set<BwString> rs = getSummaries();
if (rs == null) {
return 0;
}
@@ -693,7 +693,7 @@
* @see org.bedework.calfacade.base.SummaryEntity#addSummary(org.bedework.calfacade.BwString)
*/
public void addSummary(BwString val) {
- Collection<BwString> rs = getSummaries();
+ Set<BwString> rs = getSummaries();
if (rs == null) {
rs = new TreeSet<BwString>();
setSummaries(rs);
@@ -708,7 +708,7 @@
* @see org.bedework.calfacade.base.SummaryEntity#removeSummary(org.bedework.calfacade.BwString)
*/
public boolean removeSummary(BwString val) {
- Collection<BwString> c = getSummaries();
+ Set<BwString> c = getSummaries();
if (c == null) {
return false;
}
@@ -944,7 +944,7 @@
String attach,
String description,
String summary,
- Collection<BwAttendee> attendees) throws CalFacadeException {
+ Set<BwAttendee> attendees) throws CalFacadeException {
return new BwAlarm(event, owner, alarmTypeEmail,
trigger, triggerStart, triggerDateTime,
duration, repeat,
Modified: trunk/calFacade/src/org/bedework/calfacade/BwCalendar.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwCalendar.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwCalendar.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -69,6 +69,7 @@
import java.net.URLEncoder;
import java.util.Collection;
import java.util.Date;
+import java.util.Set;
import java.util.TreeSet;
/** A calendar in Bedework. This is roughly equivalent to a folder with some
@@ -233,7 +234,7 @@
*/
private int sequence;
- private Collection<BwCategory> categories = null;
+ private Set<BwCategory> categories = null;
private Collection<BwProperty> properties;
@@ -309,7 +310,7 @@
String created,
String lastmod,
int sequence,
- Collection<BwCategory> categories,
+ Set<BwCategory> categories,
Collection<BwProperty> properties,
String aliasUri,
boolean display,
@@ -520,16 +521,16 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Collection)
+ * @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Set)
*/
- public void setCategories(Collection<BwCategory> val) {
+ public void setCategories(Set<BwCategory> val) {
categories = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#getCategories()
*/
- public Collection<BwCategory> getCategories() {
+ public Set<BwCategory> getCategories() {
return categories;
}
@@ -537,7 +538,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#getNumCategories()
*/
public int getNumCategories() {
- Collection<BwCategory> c = getCategories();
+ Set<BwCategory> c = getCategories();
if (c == null) {
return 0;
}
@@ -549,7 +550,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#addCategory(org.bedework.calfacade.BwCategory)
*/
public void addCategory(BwCategory val) {
- Collection<BwCategory> cats = getCategories();
+ Set<BwCategory> cats = getCategories();
if (cats == null) {
cats = new TreeSet<BwCategory>();
setCategories(cats);
@@ -564,7 +565,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#removeCategory(org.bedework.calfacade.BwCategory)
*/
public boolean removeCategory(BwCategory val) {
- Collection<BwCategory> cats = getCategories();
+ Set<BwCategory> cats = getCategories();
if (cats == null) {
return false;
}
@@ -576,7 +577,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#hasCategory(org.bedework.calfacade.BwCategory)
*/
public boolean hasCategory(BwCategory val) {
- Collection<BwCategory> cats = getCategories();
+ Set<BwCategory> cats = getCategories();
if (cats == null) {
return false;
}
@@ -587,7 +588,7 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#copyCategories()
*/
- public Collection<BwCategory> copyCategories() {
+ public Set<BwCategory> copyCategories() {
if (getNumCategories() == 0) {
return null;
}
@@ -603,7 +604,7 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#cloneCategories()
*/
- public Collection<BwCategory> cloneCategories() {
+ public Set<BwCategory> cloneCategories() {
if (getNumCategories() == 0) {
return null;
}
Modified: trunk/calFacade/src/org/bedework/calfacade/BwEvent.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwEvent.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwEvent.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -81,6 +81,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
import java.util.TreeSet;
/** An Event in Bedework. The event class is actually used to represent most of
@@ -290,15 +292,15 @@
private String name;
- private Collection<BwString> summaries;
+ private Set<BwString> summaries;
- private Collection<BwLongString> descriptions;
+ private Set<BwLongString> descriptions;
private String classification;
- private Collection<BwString> comments;
+ private Set<BwString> comments;
- private Collection<BwString> resources;
+ private Set<BwString> resources;
private BwDateTime dtstart;
private BwDateTime dtend;
@@ -386,11 +388,11 @@
/** A Set of BwCategory objects
*/
- private Collection<BwCategory> categories = null;
+ private Set<BwCategory> categories = null;
/** This may or may not be set to populate fully
*/
- private Collection<BwContact> contacts;
+ private Set<BwContact> contacts;
/** This may or may not be set to populate fully
*/
@@ -420,9 +422,9 @@
/* VTODO only */
private String completed;
- private Collection<BwAttachment> attachments;
+ private Set<BwAttachment> attachments;
- private Collection<BwAttendee> attendees;
+ private Set<BwAttendee> attendees;
private Boolean recurring;
@@ -431,7 +433,7 @@
*/
private String uid;
- private Collection<BwAlarm> alarms;
+ private Set<BwAlarm> alarms;
/* ------------------- RecurrenceEntity information -------------------- */
@@ -439,21 +441,21 @@
*/
private String recurrenceId;
- /** Collection of String rrule values
+ /** Set of String rrule values
*/
- private Collection<String> rrules;
+ private Set<String> rrules;
- /** Collection of String exrule values
+ /** Set of String exrule values
*/
- private Collection<String> exrules;
+ private Set<String> exrules;
- /** Collection of BwDateTime rdate values
+ /** Set of BwDateTime rdate values
*/
- private Collection<BwDateTime> rdates;
+ private Set<BwDateTime> rdates;
- /** Collection of BwDateTime exdate values
+ /** Set of BwDateTime exdate values
*/
- private Collection<BwDateTime> exdates;
+ private Set<BwDateTime> exdates;
/** Where known this will be the absolute latest date for this recurring
* event. This field will be null for infinite events.
@@ -477,7 +479,7 @@
private String originator;
- private Collection<String> recipients;
+ private Set<String> recipients;
// ENUM
/** scheduling message has not been processed
@@ -498,7 +500,7 @@
private int scheduleState;
- private Collection<BwRequestStatus> requestStatuses;
+ private Set<BwRequestStatus> requestStatuses;
/** Deferred till later e.g. needs mailing */
public static final String requestStatusDeferred = "1.0;Deferred";
@@ -522,7 +524,7 @@
/** Collection of BwXproperty
*/
- private Collection<BwXproperty> xproperties;
+ private List<BwXproperty> xproperties;
/* ---------------------------- Temp --------------------------------
* As a quick fix we will store freebusy information in one of these.
@@ -533,9 +535,9 @@
* single master class.
*/
- /** Collection of BwFreeBusyComponent
+ /** List of BwFreeBusyComponent
*/
- private Collection<BwFreeBusyComponent> freeBusyPeriods;
+ private List<BwFreeBusyComponent> freeBusyPeriods;
/* ====================================================================
* VAvailability fields
@@ -553,7 +555,7 @@
private int busyType = busyTypeBusyUnavailable;
/* Uids of AVAILABILITY components */
- private Collection<String> availableUids;
+ private Set<String> availableUids;
/** Constructor
*/
@@ -1013,14 +1015,14 @@
journalProperty = true,
freeBusyProperty = true,
timezoneProperty = true)
- public void setXproperties(Collection<BwXproperty> val) {
+ public void setXproperties(List<BwXproperty> val) {
xproperties = val;
}
/**
- * @return Collection<BwXproperty>
+ * @return List<BwXproperty>
*/
- public Collection<BwXproperty> getXproperties() {
+ public List<BwXproperty> getXproperties() {
return xproperties;
}
@@ -1029,7 +1031,7 @@
*/
@NoProxy
public int getNumXproperties() {
- Collection<BwXproperty> c = getXproperties();
+ List<BwXproperty> c = getXproperties();
if (c == null) {
return 0;
}
@@ -1042,7 +1044,7 @@
*/
@NoProxy
public void addXproperty(BwXproperty val) {
- Collection<BwXproperty> c = getXproperties();
+ List<BwXproperty> c = getXproperties();
if (c == null) {
c = new ArrayList<BwXproperty>();
setXproperties(c);
@@ -1066,15 +1068,15 @@
todoProperty = true,
journalProperty = true,
freeBusyProperty = true)
- public void setRequestStatuses(Collection<BwRequestStatus> val) {
+ public void setRequestStatuses(Set<BwRequestStatus> val) {
requestStatuses = val;
}
/** Get the requestStatus
*
- * @return Collection of BwRequestStatus the requestStatus
+ * @return Set of BwRequestStatus the requestStatus
*/
- public Collection<BwRequestStatus> getRequestStatuses() {
+ public Set<BwRequestStatus> getRequestStatuses() {
return requestStatuses;
}
@@ -1083,7 +1085,7 @@
*/
@NoProxy
public int getNumRequestStatuses() {
- Collection<BwRequestStatus> c = getRequestStatuses();
+ Set<BwRequestStatus> c = getRequestStatuses();
if (c == null) {
return 0;
}
@@ -1096,7 +1098,7 @@
*/
@NoProxy
public void addRequestStatus(BwRequestStatus val) {
- Collection<BwRequestStatus> rs = getRequestStatuses();
+ Set<BwRequestStatus> rs = getRequestStatuses();
if (rs == null) {
rs = new TreeSet<BwRequestStatus>();
setRequestStatuses(rs);
@@ -1113,7 +1115,7 @@
*/
@NoProxy
public boolean removeRequestStatus(BwRequestStatus val) {
- Collection<BwRequestStatus> rs = getRequestStatuses();
+ Set<BwRequestStatus> rs = getRequestStatuses();
if (rs == null) {
return false;
}
@@ -1121,18 +1123,18 @@
return rs.remove(val);
}
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwAlarm
+ * @return Set of BwAlarm
*/
@NoProxy
- public Collection<BwRequestStatus> cloneRequestStatuses() {
- Collection<BwRequestStatus> rs = getRequestStatuses();
+ public Set<BwRequestStatus> cloneRequestStatuses() {
+ Set<BwRequestStatus> rs = getRequestStatuses();
if (rs == null) {
return null;
}
- Collection<BwRequestStatus> nrs = new TreeSet<BwRequestStatus>();
+ Set<BwRequestStatus> nrs = new TreeSet<BwRequestStatus>();
for (BwRequestStatus o: rs) {
nrs.add((BwRequestStatus)o.clone());
@@ -1180,74 +1182,74 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.RecurrenceEntity#setRrules(java.util.Collection)
+ * @see org.bedework.calfacade.base.RecurrenceEntity#setRrules(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.RRULE,
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setRrules(Collection<String> val) {
+ public void setRrules(Set<String> val) {
rrules = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.RecurrenceEntity#getRrules()
*/
- public Collection<String> getRrules() {
+ public Set<String> getRrules() {
return rrules;
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.RecurrenceEntity#setExrules(java.util.Collection)
+ * @see org.bedework.calfacade.base.RecurrenceEntity#setExrules(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.EXRULE,
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setExrules(Collection<String> val) {
+ public void setExrules(Set<String> val) {
exrules = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.RecurrenceEntity#getExrules()
*/
- public Collection<String> getExrules() {
+ public Set<String> getExrules() {
return exrules;
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.RecurrenceEntity#setRdates(java.util.Collection)
+ * @see org.bedework.calfacade.base.RecurrenceEntity#setRdates(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.RDATE,
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setRdates(Collection<BwDateTime> val) {
+ public void setRdates(Set<BwDateTime> val) {
rdates = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.RecurrenceEntity#getRdates()
*/
- public Collection<BwDateTime> getRdates() {
+ public Set<BwDateTime> getRdates() {
return rdates;
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.RecurrenceEntity#setExdates(java.util.Collection)
+ * @see org.bedework.calfacade.base.RecurrenceEntity#setExdates(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.EXDATE,
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setExdates(Collection<BwDateTime> val) {
+ public void setExdates(Set<BwDateTime> val) {
exdates = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.RecurrenceEntity#getExdates()
*/
- public Collection<BwDateTime> getExdates() {
+ public Set<BwDateTime> getExdates() {
return exdates;
}
@@ -1320,7 +1322,7 @@
*/
@NoProxy
public void addRrule(String val) {
- Collection<String> c = getRrules();
+ Set<String> c = getRrules();
if (c == null) {
c = new TreeSet<String>();
@@ -1346,7 +1348,7 @@
*/
@NoProxy
public void addExrule(String val) {
- Collection<String> c = getExrules();
+ Set<String> c = getExrules();
if (c == null) {
c = new TreeSet<String>();
@@ -1371,7 +1373,7 @@
*/
@NoProxy
public void addRdate(BwDateTime val) {
- Collection<BwDateTime> c = getRdates();
+ Set<BwDateTime> c = getRdates();
if (c == null) {
c = new TreeSet<BwDateTime>();
@@ -1397,7 +1399,7 @@
*/
@NoProxy
public void addExdate(BwDateTime val) {
- Collection<BwDateTime> c = getExdates();
+ Set<BwDateTime> c = getExdates();
if (c == null) {
c = new TreeSet<BwDateTime>();
@@ -1512,16 +1514,16 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.AlarmsEntity#setAlarms(java.util.Collection)
+ * @see org.bedework.calfacade.base.AlarmsEntity#setAlarms(java.util.Set)
*/
- public void setAlarms(Collection<BwAlarm> val) {
+ public void setAlarms(Set<BwAlarm> val) {
alarms = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AlarmsEntity#getAlarms()
*/
- public Collection<BwAlarm> getAlarms() {
+ public Set<BwAlarm> getAlarms() {
return alarms;
}
@@ -1530,7 +1532,7 @@
*/
@NoProxy
public int getNumAlarms() {
- Collection<BwAlarm> c = getAlarms();
+ Set<BwAlarm> c = getAlarms();
if (c == null) {
return 0;
}
@@ -1543,7 +1545,7 @@
*/
@NoProxy
public void addAlarm(BwAlarm val) {
- Collection<BwAlarm> rs = getAlarms();
+ Set<BwAlarm> rs = getAlarms();
if (rs == null) {
rs = new TreeSet<BwAlarm>();
setAlarms(rs);
@@ -1559,7 +1561,7 @@
*/
@NoProxy
public boolean removeAlarm(BwAlarm val) {
- Collection<BwAlarm> rs = getAlarms();
+ Set<BwAlarm> rs = getAlarms();
if (rs == null) {
return false;
}
@@ -1567,18 +1569,18 @@
return rs.remove(val);
}
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwAlarm
+ * @return Set of BwAlarm
*/
@NoProxy
- public Collection<BwAlarm> cloneAlarms() {
- Collection<BwAlarm> rs = getAlarms();
+ public Set<BwAlarm> cloneAlarms() {
+ Set<BwAlarm> rs = getAlarms();
if (rs == null) {
return null;
}
- Collection<BwAlarm> nrs = new TreeSet<BwAlarm>();
+ Set<BwAlarm> nrs = new TreeSet<BwAlarm>();
for (BwAlarm al: rs) {
nrs.add((BwAlarm)al.clone());
@@ -1595,17 +1597,17 @@
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setAttachments(Collection<BwAttachment> val) {
+ public void setAttachments(Set<BwAttachment> val) {
attachments = val;
}
- public Collection<BwAttachment> getAttachments() {
+ public Set<BwAttachment> getAttachments() {
return attachments;
}
@NoProxy
public int getNumAttachments() {
- Collection as = getAttachments();
+ Set as = getAttachments();
if (as == null) {
return 0;
}
@@ -1615,7 +1617,7 @@
@NoProxy
public void addAttachment(BwAttachment val) {
- Collection<BwAttachment> as = getAttachments();
+ Set<BwAttachment> as = getAttachments();
if (as == null) {
as = new TreeSet<BwAttachment>();
setAttachments(as);
@@ -1628,7 +1630,7 @@
@NoProxy
public boolean removeAttachment(BwAttachment val) {
- Collection as = getAttachments();
+ Set as = getAttachments();
if (as == null) {
return false;
}
@@ -1637,7 +1639,7 @@
}
@NoProxy
- public Collection<BwAttachment> copyAttachments() {
+ public Set<BwAttachment> copyAttachments() {
if (getNumAttachments() == 0) {
return null;
}
@@ -1651,7 +1653,7 @@
}
@NoProxy
- public Collection<BwAttachment> cloneAttachments() {
+ public Set<BwAttachment> cloneAttachments() {
if (getNumAttachments() == 0) {
return null;
}
@@ -1669,21 +1671,21 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.AttendeesEntity#setAttendees(java.util.Collection)
+ * @see org.bedework.calfacade.base.AttendeesEntity#setAttendees(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.ATTENDEE,
eventProperty = true,
todoProperty = true,
journalProperty = true,
freeBusyProperty = true)
- public void setAttendees(Collection<BwAttendee> val) {
+ public void setAttendees(Set<BwAttendee> val) {
attendees = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AttendeesEntity#getAttendees()
*/
- public Collection<BwAttendee> getAttendees() {
+ public Set<BwAttendee> getAttendees() {
return attendees;
}
@@ -1692,7 +1694,7 @@
*/
@NoProxy
public int getNumAttendees() {
- Collection as = getAttendees();
+ Set as = getAttendees();
if (as == null) {
return 0;
}
@@ -1705,7 +1707,7 @@
*/
@NoProxy
public void addAttendee(BwAttendee val) {
- Collection<BwAttendee> as = getAttendees();
+ Set<BwAttendee> as = getAttendees();
if (as == null) {
as = new TreeSet<BwAttendee>();
setAttendees(as);
@@ -1721,7 +1723,7 @@
*/
@NoProxy
public boolean removeAttendee(BwAttendee val) {
- Collection as = getAttendees();
+ Set as = getAttendees();
if (as == null) {
return false;
}
@@ -1733,7 +1735,7 @@
* @see org.bedework.calfacade.base.AttendeesEntity#copyAttendees()
*/
@NoProxy
- public Collection<BwAttendee> copyAttendees() {
+ public Set<BwAttendee> copyAttendees() {
if (getNumAttendees() == 0) {
return null;
}
@@ -1750,7 +1752,7 @@
* @see org.bedework.calfacade.base.AttendeesEntity#cloneAttendees()
*/
@NoProxy
- public Collection<BwAttendee> cloneAttendees() {
+ public Set<BwAttendee> cloneAttendees() {
if (getNumAttendees() == 0) {
return null;
}
@@ -1802,16 +1804,16 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.AttendeesEntity#setRecipients(java.util.Collection)
+ * @see org.bedework.calfacade.base.AttendeesEntity#setRecipients(java.util.Set)
*/
- public void setRecipients(Collection<String> val) {
+ public void setRecipients(Set<String> val) {
recipients = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AttendeesEntity#getRecipients()
*/
- public Collection<String> getRecipients() {
+ public Set<String> getRecipients() {
return recipients;
}
@@ -1820,7 +1822,7 @@
*/
@NoProxy
public int getNumRecipients() {
- Collection<String> rs = getRecipients();
+ Set<String> rs = getRecipients();
if (rs == null) {
return 0;
}
@@ -1833,7 +1835,7 @@
*/
@NoProxy
public void addRecipient(String val) {
- Collection<String> rs = getRecipients();
+ Set<String> rs = getRecipients();
if (rs == null) {
rs = new TreeSet<String>();
setRecipients(rs);
@@ -1849,7 +1851,7 @@
*/
@NoProxy
public boolean removeRecipient(String val) {
- Collection<String> rs = getRecipients();
+ Set<String> rs = getRecipients();
if (rs == null) {
return false;
}
@@ -1862,20 +1864,20 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Collection)
+ * @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.CATEGORIES,
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setCategories(Collection<BwCategory> val) {
+ public void setCategories(Set<BwCategory> val) {
categories = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#getCategories()
*/
- public Collection<BwCategory> getCategories() {
+ public Set<BwCategory> getCategories() {
return categories;
}
@@ -1884,7 +1886,7 @@
*/
@NoProxy
public int getNumCategories() {
- Collection<BwCategory> c = getCategories();
+ Set<BwCategory> c = getCategories();
if (c == null) {
return 0;
}
@@ -1897,7 +1899,7 @@
*/
@NoProxy
public void addCategory(BwCategory val) {
- Collection<BwCategory> cats = getCategories();
+ Set<BwCategory> cats = getCategories();
if (cats == null) {
cats = new TreeSet<BwCategory>();
setCategories(cats);
@@ -1913,7 +1915,7 @@
*/
@NoProxy
public boolean removeCategory(BwCategory val) {
- Collection cats = getCategories();
+ Set cats = getCategories();
if (cats == null) {
return false;
}
@@ -1926,7 +1928,7 @@
*/
@NoProxy
public boolean hasCategory(BwCategory val) {
- Collection cats = getCategories();
+ Set cats = getCategories();
if (cats == null) {
return false;
}
@@ -1938,7 +1940,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#copyCategories()
*/
@NoProxy
- public Collection<BwCategory> copyCategories() {
+ public Set<BwCategory> copyCategories() {
if (getNumCategories() == 0) {
return null;
}
@@ -1955,7 +1957,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#cloneCategories()
*/
@NoProxy
- public Collection<BwCategory> cloneCategories() {
+ public Set<BwCategory> cloneCategories() {
if (getNumCategories() == 0) {
return null;
}
@@ -1973,7 +1975,7 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CommentedEntity#setComments(java.util.Collection)
+ * @see org.bedework.calfacade.base.CommentedEntity#setComments(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.COMMENT,
eventProperty = true,
@@ -1981,14 +1983,14 @@
journalProperty = true,
freeBusyProperty = true,
timezoneProperty = true)
- public void setComments(Collection<BwString> val) {
+ public void setComments(Set<BwString> val) {
comments = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CommentedEntity#getComments()
*/
- public Collection<BwString> getComments() {
+ public Set<BwString> getComments() {
return comments;
}
@@ -1997,7 +1999,7 @@
*/
@NoProxy
public int getNumComments() {
- Collection rs = getComments();
+ Set rs = getComments();
if (rs == null) {
return 0;
}
@@ -2018,7 +2020,7 @@
*/
@NoProxy
public void addComment(BwString val) {
- Collection<BwString> rs = getComments();
+ Set<BwString> rs = getComments();
if (rs == null) {
rs = new TreeSet<BwString>();
setComments(rs);
@@ -2034,7 +2036,7 @@
*/
@NoProxy
public boolean removeComment(BwString val) {
- Collection rs = getComments();
+ Set rs = getComments();
if (rs == null) {
return false;
}
@@ -2046,13 +2048,13 @@
* Contact interface methods
* ==================================================================== */
- /** Transition method - replace collection with single value.
+ /** Transition method - replace Set with single value.
*
* @param val
*/
@NoProxy
public void setContact(BwContact val) {
- Collection<BwContact> c = getContacts();
+ Set<BwContact> c = getContacts();
if ((c != null) && (!c.isEmpty())) {
c.clear();
}
@@ -2068,7 +2070,7 @@
*/
@NoProxy
public BwContact getContact() {
- Collection<BwContact> c = getContacts();
+ Set<BwContact> c = getContacts();
if ((c == null) || (c.isEmpty())) {
return null;
}
@@ -2077,21 +2079,21 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CategorisedEntity#setContacts(java.util.Collection)
+ * @see org.bedework.calfacade.base.CategorisedEntity#setContacts(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.CONTACT,
eventProperty = true,
todoProperty = true,
journalProperty = true,
freeBusyProperty = true)
- public void setContacts(Collection<BwContact> val) {
+ public void setContacts(Set<BwContact> val) {
contacts = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#getContacts()
*/
- public Collection<BwContact> getContacts() {
+ public Set<BwContact> getContacts() {
return contacts;
}
@@ -2100,7 +2102,7 @@
*/
@NoProxy
public int getNumContacts() {
- Collection<BwContact> c = getContacts();
+ Set<BwContact> c = getContacts();
if (c == null) {
return 0;
}
@@ -2113,7 +2115,7 @@
*/
@NoProxy
public void addContact(BwContact val) {
- Collection<BwContact> cs = getContacts();
+ Set<BwContact> cs = getContacts();
if (cs == null) {
cs = new TreeSet<BwContact>();
setContacts(cs);
@@ -2129,7 +2131,7 @@
*/
@NoProxy
public boolean removeContact(BwContact val) {
- Collection cs = getContacts();
+ Set cs = getContacts();
if (cs == null) {
return false;
}
@@ -2142,7 +2144,7 @@
*/
@NoProxy
public boolean hasContact(BwContact val) {
- Collection cs = getContacts();
+ Set cs = getContacts();
if (cs == null) {
return false;
}
@@ -2154,7 +2156,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#copyContacts()
*/
@NoProxy
- public Collection<BwContact> copyContacts() {
+ public Set<BwContact> copyContacts() {
if (getNumContacts() == 0) {
return null;
}
@@ -2171,7 +2173,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#cloneContacts()
*/
@NoProxy
- public Collection<BwContact> cloneContacts() {
+ public Set<BwContact> cloneContacts() {
if (getNumContacts() == 0) {
return null;
}
@@ -2189,20 +2191,20 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Collection)
+ * @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.DESCRIPTION,
eventProperty = true,
todoProperty = true,
journalProperty = true)
- public void setDescriptions(Collection<BwLongString> val) {
+ public void setDescriptions(Set<BwLongString> val) {
descriptions = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.DescriptionEntity#getDescriptions()
*/
- public Collection<BwLongString> getDescriptions() {
+ public Set<BwLongString> getDescriptions() {
return descriptions;
}
@@ -2211,7 +2213,7 @@
*/
@NoProxy
public int getNumDescriptions() {
- Collection<BwLongString> rs = getDescriptions();
+ Set<BwLongString> rs = getDescriptions();
if (rs == null) {
return 0;
}
@@ -2232,7 +2234,7 @@
*/
@NoProxy
public void addDescription(BwLongString val) {
- Collection<BwLongString> rs = getDescriptions();
+ Set<BwLongString> rs = getDescriptions();
if (rs == null) {
rs = new TreeSet<BwLongString>();
setDescriptions(rs);
@@ -2248,7 +2250,7 @@
*/
@NoProxy
public boolean removeDescription(BwLongString val) {
- Collection rs = getDescriptions();
+ Set rs = getDescriptions();
if (rs == null) {
return false;
}
@@ -2311,19 +2313,19 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.ResourcedEntity#setResources(java.util.Collection)
+ * @see org.bedework.calfacade.base.ResourcedEntity#setResources(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.RESOURCES,
eventProperty = true,
todoProperty = true)
- public void setResources(Collection<BwString> val) {
+ public void setResources(Set<BwString> val) {
resources = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.ResourcedEntity#getResources()
*/
- public Collection<BwString> getResources() {
+ public Set<BwString> getResources() {
return resources;
}
@@ -2332,7 +2334,7 @@
*/
@NoProxy
public int getNumResources() {
- Collection rs = getResources();
+ Set rs = getResources();
if (rs == null) {
return 0;
}
@@ -2353,7 +2355,7 @@
*/
@NoProxy
public void addResource(BwString val) {
- Collection<BwString> rs = getResources();
+ Set<BwString> rs = getResources();
if (rs == null) {
rs = new TreeSet<BwString>();
setResources(rs);
@@ -2369,7 +2371,7 @@
*/
@NoProxy
public boolean removeResource(BwString val) {
- Collection rs = getResources();
+ Set rs = getResources();
if (rs == null) {
return false;
}
@@ -2382,16 +2384,16 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.SummaryEntity#setSummaries(java.util.Collection)
+ * @see org.bedework.calfacade.base.SummaryEntity#setSummaries(java.util.Set)
*/
- public void setSummaries(Collection<BwString> val) {
+ public void setSummaries(Set<BwString> val) {
summaries = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.SummaryEntity#getSummaries()
*/
- public Collection<BwString> getSummaries() {
+ public Set<BwString> getSummaries() {
return summaries;
}
@@ -2400,7 +2402,7 @@
*/
@NoProxy
public int getNumSummaries() {
- Collection rs = getSummaries();
+ Set rs = getSummaries();
if (rs == null) {
return 0;
}
@@ -2421,7 +2423,7 @@
*/
@NoProxy
public void addSummary(BwString val) {
- Collection<BwString> rs = getSummaries();
+ Set<BwString> rs = getSummaries();
if (rs == null) {
rs = new TreeSet<BwString>();
setSummaries(rs);
@@ -2437,7 +2439,7 @@
*/
@NoProxy
public boolean removeSummary(BwString val) {
- Collection<BwString> c = getSummaries();
+ Set<BwString> c = getSummaries();
if (c == null) {
return false;
}
@@ -2459,7 +2461,7 @@
} else if (s == null) {
addSummary(lang, val);
} else if ((CalFacadeUtil.cmpObjval(val, s.getValue()) != 0)) {
- // XXX Cannot change value in case this is an override collection.
+ // XXX Cannot change value in case this is an override Set.
//s.setValue(val);
removeSummary(s);
@@ -2506,19 +2508,19 @@
/** set the free busy periods
*
- * @param val Collection of BwFreeBusyComponent
+ * @param val List of BwFreeBusyComponent
*/
@NoProxy
- public void setFreeBusyPeriods(Collection<BwFreeBusyComponent> val) {
+ public void setFreeBusyPeriods(List<BwFreeBusyComponent> val) {
freeBusyPeriods = val;
}
/** Get the free busy times
*
- * @return Collection of BwFreeBusyComponent
+ * @return Set of BwFreeBusyComponent
*/
@NoProxy
- public Collection<BwFreeBusyComponent> getFreeBusyPeriods() {
+ public List<BwFreeBusyComponent> getFreeBusyPeriods() {
return freeBusyPeriods;
}
@@ -2528,7 +2530,7 @@
*/
@NoProxy
public void addFreeBusyPeriod(BwFreeBusyComponent val) {
- Collection<BwFreeBusyComponent> fbps = getFreeBusyPeriods();
+ List<BwFreeBusyComponent> fbps = getFreeBusyPeriods();
if (fbps == null) {
fbps = new ArrayList<BwFreeBusyComponent>();
@@ -2560,19 +2562,19 @@
/** Set the available uids
*
- * @param val Collection<String>
+ * @param val Set<String>
*/
@NoProxy
- public void setAvailableUids(Collection<String> val) {
+ public void setAvailableUids(Set<String> val) {
availableUids = val;
}
/** Get the uids
*
- * @return Collection<String> uids
+ * @return Set<String> uids
*/
@NoProxy
- public Collection<String> getAvailableUids() {
+ public Set<String> getAvailableUids() {
return availableUids;
}
@@ -2582,7 +2584,7 @@
*/
@NoProxy
public void addAvailableUid(String val) {
- Collection<String> avls = getAvailableUids();
+ Set<String> avls = getAvailableUids();
if (avls == null) {
avls = new TreeSet<String>();
@@ -2602,12 +2604,12 @@
* added by another user to ensure that the target user has a copy of user
* specific timezones.
*
- * @return Collection of timezone ids.
+ * @return Set of timezone ids.
* @throws CalFacadeException
*/
@NoProxy
- public Collection<String> getTimeZoneIds() throws CalFacadeException {
- Collection<String> ids = new TreeSet<String>();
+ public Set<String> getTimeZoneIds() throws CalFacadeException {
+ Set<String> ids = new TreeSet<String>();
BwDateTime dt = getDtstart();
if ((dt != null) && (dt.getTzid() != null)) {
@@ -2619,7 +2621,7 @@
ids.add(dt.getTzid());
}
- Collection<BwDateTime> dts = getRdates();
+ Set<BwDateTime> dts = getRdates();
if (dts != null) {
for (BwDateTime rdt: dts) {
if (rdt.getTzid() != null) {
@@ -2637,7 +2639,7 @@
}
}
- Collection<BwFreeBusyComponent> fbcs = getFreeBusyPeriods();
+ List<BwFreeBusyComponent> fbcs = getFreeBusyPeriods();
if (fbcs != null) {
for (BwFreeBusyComponent fbc: fbcs) {
for (Period p: fbc.getPeriods()) {
@@ -2740,8 +2742,8 @@
res.setOwner(getOwner());
if (getEntityType() == CalFacadeDefs.entityTypeFreeAndBusy) {
- Collection<BwFreeBusyComponent> fbcs = getFreeBusyPeriods();
- Collection<BwFreeBusyComponent> newfbcs = new ArrayList<BwFreeBusyComponent>();
+ List<BwFreeBusyComponent> fbcs = getFreeBusyPeriods();
+ List<BwFreeBusyComponent> newfbcs = new ArrayList<BwFreeBusyComponent>();
for (BwFreeBusyComponent fbc: fbcs) {
newfbcs.add((BwFreeBusyComponent)fbc.clone());
@@ -3303,6 +3305,20 @@
return (c == null) || (c.size() == 0);
}
+ private <T> Set<T> clone(Set<T> c) {
+ if (c == null) {
+ return null;
+ }
+
+ TreeSet<T> ts = new TreeSet<T>();
+
+ for (T ent: c) {
+ ts.add(ent);
+ }
+
+ return ts;
+ }
+
private <T> Collection<T> clone(Collection<T> c) {
if (c == null) {
return null;
Modified: trunk/calFacade/src/org/bedework/calfacade/BwEventObj.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwEventObj.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwEventObj.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -55,7 +55,7 @@
import org.bedework.calfacade.ifs.ScheduleMethods;
-import java.util.Collection;
+import java.util.Set;
/** An Event in Bedework.
*
@@ -85,8 +85,8 @@
BwDateTime end,
BwOrganizer organizer,
String originator,
- Collection<BwAttendee> attendees,
- Collection<String> recipients) {
+ Set<BwAttendee> attendees,
+ Set<String> recipients) {
BwEvent fbreq = new BwEventObj();
if (organizer == null) {
Modified: trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -53,13 +53,13 @@
*/
package org.bedework.calfacade;
-import org.bedework.calfacade.base.OverrideCollection;
+import org.bedework.calfacade.base.OverrideList;
+import org.bedework.calfacade.base.OverrideSet;
import org.bedework.calfacade.exc.CalFacadeException;
import org.bedework.calfacade.util.CalFacadeUtil;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.TreeSet;
+import java.util.List;
+import java.util.Set;
/** An event proxy in Bedework.If an event is an alias or reference to another
* event, this class holds links to both. The referring event will hold user
@@ -756,30 +756,26 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#setXproperties(java.util.List)
*/
- public void setXproperties(Collection<BwXproperty> val) {
+ public void setXproperties(List<BwXproperty> val) {
ref.setXproperties(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getXproperties()
*/
- public Collection<BwXproperty> getXproperties() {
- Collection<BwXproperty> c = super.getXproperties();
+ public List<BwXproperty> getXproperties() {
+ List<BwXproperty> c = super.getXproperties();
if (c == null) {
- c = new OverrideCollection<BwXproperty>() {
- public void setOverrideCollection(Collection<BwXproperty> val) {
+ c = new OverrideList<BwXproperty>() {
+ public void setOverrideCollection(List<BwXproperty> val) {
ref.setXproperties(val);
}
- public Collection<BwXproperty> getOverrideCollection() {
+ public List<BwXproperty> getOverrideCollection() {
return ref.getXproperties();
}
- public Collection<BwXproperty> getEmptyOverrideCollection() {
- return new ArrayList<BwXproperty>();
- }
-
- public Collection<BwXproperty> getMasterCollection() {
+ public List<BwXproperty> getMasterCollection() {
return getTarget().getXproperties();
}
@@ -805,30 +801,26 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#setRequestStatuses(java.util.Collection)
*/
- public void setRequestStatuses(Collection<BwRequestStatus> val) {
+ public void setRequestStatuses(Set<BwRequestStatus> val) {
ref.setRequestStatuses(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getRequestStatuses()
*/
- public Collection<BwRequestStatus> getRequestStatuses() {
- Collection<BwRequestStatus> c = super.getRequestStatuses();
+ public Set<BwRequestStatus> getRequestStatuses() {
+ Set<BwRequestStatus> c = super.getRequestStatuses();
if (c == null) {
- c = new OverrideCollection<BwRequestStatus>() {
- public void setOverrideCollection(Collection<BwRequestStatus> val) {
+ c = new OverrideSet<BwRequestStatus>() {
+ public void setOverrideCollection(Set<BwRequestStatus> val) {
ref.setRequestStatuses(val);
}
- public Collection<BwRequestStatus> getOverrideCollection() {
+ public Set<BwRequestStatus> getOverrideCollection() {
return ref.getRequestStatuses();
}
- public Collection<BwRequestStatus> getEmptyOverrideCollection() {
- return new TreeSet<BwRequestStatus>();
- }
-
- public Collection<BwRequestStatus> getMasterCollection() {
+ public Set<BwRequestStatus> getMasterCollection() {
return getTarget().getRequestStatuses();
}
@@ -888,32 +880,28 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setRrules(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setRrules(java.util.Set)
*/
- public void setRrules(Collection<String> val) {
+ public void setRrules(Set<String> val) {
ref.setRrules(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getRrules()
*/
- public Collection<String> getRrules() {
- Collection<String> c = super.getRrules();
+ public Set<String> getRrules() {
+ Set<String> c = super.getRrules();
if (c == null) {
- c = new OverrideCollection<String>() {
- public void setOverrideCollection(Collection<String> val) {
+ c = new OverrideSet<String>() {
+ public void setOverrideCollection(Set<String> val) {
ref.setRrules(val);
}
- public Collection<String> getOverrideCollection() {
+ public Set<String> getOverrideCollection() {
return ref.getRrules();
}
- public Collection<String> getEmptyOverrideCollection() {
- return new TreeSet<String>();
- }
-
- public Collection<String> getMasterCollection() {
+ public Set<String> getMasterCollection() {
return getTarget().getRrules();
}
@@ -933,32 +921,28 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setExrules(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setExrules(java.util.Set)
*/
- public void setExrules(Collection<String> val) {
+ public void setExrules(Set<String> val) {
ref.setExrules(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getExrules()
*/
- public Collection<String> getExrules() {
- Collection<String> c = super.getExrules();
+ public Set<String> getExrules() {
+ Set<String> c = super.getExrules();
if (c == null) {
- c = new OverrideCollection<String>() {
- public void setOverrideCollection(Collection<String> val) {
+ c = new OverrideSet<String>() {
+ public void setOverrideCollection(Set<String> val) {
ref.setExrules(val);
}
- public Collection<String> getOverrideCollection() {
+ public Set<String> getOverrideCollection() {
return ref.getExrules();
}
- public Collection<String> getEmptyOverrideCollection() {
- return new TreeSet<String>();
- }
-
- public Collection<String> getMasterCollection() {
+ public Set<String> getMasterCollection() {
return getTarget().getExrules();
}
@@ -978,32 +962,28 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setRdates(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setRdates(java.util.Set)
*/
- public void setRdates(Collection<BwDateTime> val) {
+ public void setRdates(Set<BwDateTime> val) {
ref.setRdates(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getRdates()
*/
- public Collection<BwDateTime> getRdates() {
- Collection<BwDateTime> c = super.getRdates();
+ public Set<BwDateTime> getRdates() {
+ Set<BwDateTime> c = super.getRdates();
if (c == null) {
- c = new OverrideCollection<BwDateTime>() {
- public void setOverrideCollection(Collection<BwDateTime> val) {
+ c = new OverrideSet<BwDateTime>() {
+ public void setOverrideCollection(Set<BwDateTime> val) {
ref.setRdates(val);
}
- public Collection<BwDateTime> getOverrideCollection() {
+ public Set<BwDateTime> getOverrideCollection() {
return ref.getRdates();
}
- public Collection<BwDateTime> getEmptyOverrideCollection() {
- return new TreeSet<BwDateTime>();
- }
-
- public Collection<BwDateTime> getMasterCollection() {
+ public Set<BwDateTime> getMasterCollection() {
return getTarget().getRdates();
}
@@ -1023,32 +1003,28 @@
}
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setExdates(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setExdates(java.util.Set)
*/
- public void setExdates(Collection<BwDateTime> val) {
+ public void setExdates(Set<BwDateTime> val) {
ref.setExdates(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getExdates()
*/
- public Collection<BwDateTime> getExdates() {
- Collection<BwDateTime> c = super.getExdates();
+ public Set<BwDateTime> getExdates() {
+ Set<BwDateTime> c = super.getExdates();
if (c == null) {
- c = new OverrideCollection<BwDateTime>() {
- public void setOverrideCollection(Collection<BwDateTime> val) {
+ c = new OverrideSet<BwDateTime>() {
+ public void setOverrideCollection(Set<BwDateTime> val) {
ref.setExdates(val);
}
- public Collection<BwDateTime> getOverrideCollection() {
+ public Set<BwDateTime> getOverrideCollection() {
return ref.getExdates();
}
- public Collection<BwDateTime> getEmptyOverrideCollection() {
- return new TreeSet<BwDateTime>();
- }
-
- public Collection<BwDateTime> getMasterCollection() {
+ public Set<BwDateTime> getMasterCollection() {
return getTarget().getExdates();
}
@@ -1231,32 +1207,28 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.AlarmsEntity#setAlarms(java.util.Collection)
+ * @see org.bedework.calfacade.base.AlarmsEntity#setAlarms(java.util.Set)
*/
- public void setAlarms(Collection<BwAlarm> val) {
+ public void setAlarms(Set<BwAlarm> val) {
ref.setAlarms(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.AlarmsEntity#getAlarms()
*/
- public Collection<BwAlarm> getAlarms() {
- Collection<BwAlarm> c = super.getAlarms();
+ public Set<BwAlarm> getAlarms() {
+ Set<BwAlarm> c = super.getAlarms();
if (c == null) {
- c = new OverrideCollection<BwAlarm>() {
- public void setOverrideCollection(Collection<BwAlarm> val) {
+ c = new OverrideSet<BwAlarm>() {
+ public void setOverrideCollection(Set<BwAlarm> val) {
ref.setAlarms(val);
}
- public Collection<BwAlarm> getOverrideCollection() {
+ public Set<BwAlarm> getOverrideCollection() {
return ref.getAlarms();
}
- public Collection<BwAlarm> getEmptyOverrideCollection() {
- return new TreeSet<BwAlarm>();
- }
-
- public Collection<BwAlarm> getMasterCollection() {
+ public Set<BwAlarm> getMasterCollection() {
return getTarget().getAlarms();
}
@@ -1280,32 +1252,28 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setAttendees(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setAttendees(java.util.Set)
*/
- public void setAttendees(Collection<BwAttendee> val) {
+ public void setAttendees(Set<BwAttendee> val) {
ref.setAttendees(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getAttendees()
*/
- public Collection<BwAttendee> getAttendees() {
- Collection<BwAttendee> c = super.getAttendees();
+ public Set<BwAttendee> getAttendees() {
+ Set<BwAttendee> c = super.getAttendees();
if (c == null) {
- c = new OverrideCollection<BwAttendee>() {
- public void setOverrideCollection(Collection<BwAttendee> val) {
+ c = new OverrideSet<BwAttendee>() {
+ public void setOverrideCollection(Set<BwAttendee> val) {
ref.setAttendees(val);
}
- public Collection<BwAttendee> getOverrideCollection() {
+ public Set<BwAttendee> getOverrideCollection() {
return ref.getAttendees();
}
- public Collection<BwAttendee> getEmptyOverrideCollection() {
- return new TreeSet<BwAttendee>();
- }
-
- public Collection<BwAttendee> getMasterCollection() {
+ public Set<BwAttendee> getMasterCollection() {
return getTarget().getAttendees();
}
@@ -1328,27 +1296,23 @@
* CategorisedEntity interface methods
* ==================================================================== */
- public void setCategories(Collection<BwCategory> val) {
+ public void setCategories(Set<BwCategory> val) {
ref.setCategories(val);
}
- public Collection<BwCategory> getCategories() {
- Collection<BwCategory> c = super.getCategories();
+ public Set<BwCategory> getCategories() {
+ Set<BwCategory> c = super.getCategories();
if (c == null) {
- c = new OverrideCollection<BwCategory>() {
- public void setOverrideCollection(Collection<BwCategory> val) {
+ c = new OverrideSet<BwCategory>() {
+ public void setOverrideCollection(Set<BwCategory> val) {
ref.setCategories(val);
}
- public Collection<BwCategory> getOverrideCollection() {
+ public Set<BwCategory> getOverrideCollection() {
return ref.getCategories();
}
- public Collection<BwCategory> getEmptyOverrideCollection() {
- return new TreeSet<BwCategory>();
- }
-
- public Collection<BwCategory> getMasterCollection() {
+ public Set<BwCategory> getMasterCollection() {
return getTarget().getCategories();
}
@@ -1372,32 +1336,28 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CommentedEntity#setComments(java.util.Collection)
+ * @see org.bedework.calfacade.base.CommentedEntity#setComments(java.util.Set)
*/
- public void setComments(Collection<BwString> val) {
+ public void setComments(Set<BwString> val) {
ref.setComments(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CommentedEntity#getComments()
*/
- public Collection<BwString> getComments() {
- Collection<BwString> c = super.getComments();
+ public Set<BwString> getComments() {
+ Set<BwString> c = super.getComments();
if (c == null) {
- c = new OverrideCollection<BwString>() {
- public void setOverrideCollection(Collection<BwString> val) {
+ c = new OverrideSet<BwString>() {
+ public void setOverrideCollection(Set<BwString> val) {
ref.setComments(val);
}
- public Collection<BwString> getOverrideCollection() {
+ public Set<BwString> getOverrideCollection() {
return ref.getComments();
}
- public Collection<BwString> getEmptyOverrideCollection() {
- return new TreeSet<BwString>();
- }
-
- public Collection<BwString> getMasterCollection() {
+ public Set<BwString> getMasterCollection() {
return getTarget().getComments();
}
@@ -1421,32 +1381,28 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CategorisedEntity#setContacts(java.util.Collection)
+ * @see org.bedework.calfacade.base.CategorisedEntity#setContacts(java.util.Set)
*/
- public void setContacts(Collection<BwContact> val) {
+ public void setContacts(Set<BwContact> val) {
ref.setContacts(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#getContacts()
*/
- public Collection<BwContact> getContacts() {
- Collection<BwContact> c = super.getContacts();
+ public Set<BwContact> getContacts() {
+ Set<BwContact> c = super.getContacts();
if (c == null) {
- c = new OverrideCollection<BwContact>() {
- public void setOverrideCollection(Collection<BwContact> val) {
+ c = new OverrideSet<BwContact>() {
+ public void setOverrideCollection(Set<BwContact> val) {
ref.setContacts(val);
}
- public Collection<BwContact> getOverrideCollection() {
+ public Set<BwContact> getOverrideCollection() {
return ref.getContacts();
}
- public Collection<BwContact> getEmptyOverrideCollection() {
- return new TreeSet<BwContact>();
- }
-
- public Collection<BwContact> getMasterCollection() {
+ public Set<BwContact> getMasterCollection() {
return getTarget().getContacts();
}
@@ -1470,32 +1426,28 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setDescriptions(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setDescriptions(java.util.Set)
*/
- public void setDescriptions(Collection<BwLongString> val) {
+ public void setDescriptions(Set<BwLongString> val) {
ref.setDescriptions(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getDescriptions()
*/
- public Collection<BwLongString> getDescriptions() {
- Collection<BwLongString> c = super.getDescriptions();
+ public Set<BwLongString> getDescriptions() {
+ Set<BwLongString> c = super.getDescriptions();
if (c == null) {
- c = new OverrideCollection<BwLongString>() {
- public void setOverrideCollection(Collection<BwLongString> val) {
+ c = new OverrideSet<BwLongString>() {
+ public void setOverrideCollection(Set<BwLongString> val) {
ref.setDescriptions(val);
}
- public Collection<BwLongString> getOverrideCollection() {
+ public Set<BwLongString> getOverrideCollection() {
return ref.getDescriptions();
}
- public Collection<BwLongString> getEmptyOverrideCollection() {
- return new TreeSet<BwLongString>();
- }
-
- public Collection<BwLongString> getMasterCollection() {
+ public Set<BwLongString> getMasterCollection() {
return getTarget().getDescriptions();
}
@@ -1519,32 +1471,28 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.ResourcedEntity#setResources(java.util.Collection)
+ * @see org.bedework.calfacade.base.ResourcedEntity#setResources(java.util.Set)
*/
- public void setResources(Collection<BwString> val) {
+ public void setResources(Set<BwString> val) {
ref.setResources(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.ResourcedEntity#getResources()
*/
- public Collection<BwString> getResources() {
- Collection<BwString> c = super.getResources();
+ public Set<BwString> getResources() {
+ Set<BwString> c = super.getResources();
if (c == null) {
- c = new OverrideCollection<BwString>() {
- public void setOverrideCollection(Collection<BwString> val) {
+ c = new OverrideSet<BwString>() {
+ public void setOverrideCollection(Set<BwString> val) {
ref.setResources(val);
}
- public Collection<BwString> getOverrideCollection() {
+ public Set<BwString> getOverrideCollection() {
return ref.getResources();
}
- public Collection<BwString> getEmptyOverrideCollection() {
- return new TreeSet<BwString>();
- }
-
- public Collection<BwString> getMasterCollection() {
+ public Set<BwString> getMasterCollection() {
return getTarget().getResources();
}
@@ -1568,9 +1516,9 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.BwEvent#setSummaries(java.util.Collection)
+ * @see org.bedework.calfacade.BwEvent#setSummaries(java.util.Set)
*/
- public void setSummaries(Collection<BwString> val) {
+ public void setSummaries(Set<BwString> val) {
ref.setSummaries(val);
}
@@ -1580,23 +1528,19 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.BwEvent#getSummaries()
*/
- public Collection<BwString> getSummaries() {
- Collection<BwString> c = super.getSummaries();
+ public Set<BwString> getSummaries() {
+ Set<BwString> c = super.getSummaries();
if (c == null) {
- c = new OverrideCollection<BwString>() {
- public void setOverrideCollection(Collection<BwString> val) {
+ c = new OverrideSet<BwString>() {
+ public void setOverrideCollection(Set<BwString> val) {
ref.setSummaries(val);
}
- public Collection<BwString> getOverrideCollection() {
+ public Set<BwString> getOverrideCollection() {
return ref.getSummaries();
}
- public Collection<BwString> getEmptyOverrideCollection() {
- return new TreeSet<BwString>();
- }
-
- public Collection<BwString> getMasterCollection() {
+ public Set<BwString> getMasterCollection() {
return getTarget().getSummaries();
}
@@ -1619,35 +1563,31 @@
* Recipients methods
* ==================================================================== */
- /** Set the recipients collection
+ /** Set the recipients Set
*
- * @param val Collection of (String)recipients
+ * @param val Set of (String)recipients
*/
- public void setRecipients(Collection<String> val) {
+ public void setRecipients(Set<String> val) {
ref.setRecipients(val);
}
/** Get the recipients
*
- * @return Collection recipients set
+ * @return Set recipients set
*/
- public Collection<String> getRecipients() {
- Collection<String> c = super.getRecipients();
+ public Set<String> getRecipients() {
+ Set<String> c = super.getRecipients();
if (c == null) {
- c = new OverrideCollection<String>() {
- public void setOverrideCollection(Collection<String> val) {
+ c = new OverrideSet<String>() {
+ public void setOverrideCollection(Set<String> val) {
ref.setRecipients(val);
}
- public Collection<String> getOverrideCollection() {
+ public Set<String> getOverrideCollection() {
return ref.getRecipients();
}
- public Collection<String> getEmptyOverrideCollection() {
- return new TreeSet<String>();
- }
-
- public Collection<String> getMasterCollection() {
+ public Set<String> getMasterCollection() {
return getTarget().getRecipients();
}
Modified: trunk/calFacade/src/org/bedework/calfacade/BwFilterDef.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwFilterDef.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwFilterDef.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -33,6 +33,7 @@
import java.util.Collection;
import java.util.Comparator;
+import java.util.Set;
import java.util.TreeSet;
/**
@@ -73,7 +74,7 @@
/** Some sort of description - may be null
*/
- private Collection<BwLongString> descriptions;
+ private Set<BwLongString> descriptions;
/* This field is not persisted */
private BwFilter filters;
@@ -217,14 +218,14 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Collection)
*/
- public void setDescriptions(Collection<BwLongString> val) {
+ public void setDescriptions(Set<BwLongString> val) {
descriptions = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.DescriptionEntity#getDescriptions()
*/
- public Collection<BwLongString> getDescriptions() {
+ public Set<BwLongString> getDescriptions() {
return descriptions;
}
@@ -251,7 +252,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#addDescription(org.bedework.calfacade.BwString)
*/
public void addDescription(BwLongString val) {
- Collection<BwLongString> rs = getDescriptions();
+ Set<BwLongString> rs = getDescriptions();
if (rs == null) {
rs = new TreeSet<BwLongString>();
setDescriptions(rs);
Modified: trunk/calFacade/src/org/bedework/calfacade/BwVenue.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwVenue.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/BwVenue.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -35,7 +35,7 @@
import org.bedework.calfacade.util.CalFacadeUtil;
import java.io.Serializable;
-import java.util.Collection;
+import java.util.Set;
import java.util.Comparator;
import java.util.TreeSet;
@@ -57,11 +57,11 @@
/** A Set of BwCategory objects
*/
- private Collection<BwCategory> categories = null;
+ private Set<BwCategory> categories = null;
private AbbreviatedValue country;
- private Collection<BwString> descriptions;
+ private Set<BwString> descriptions;
private String extendedAddress;
@@ -69,7 +69,7 @@
private String locality;
- private Collection<String> locationTypes;
+ private Set<String> locationTypes;
private String name;
@@ -85,7 +85,7 @@
private String tzid;
- private Collection<TypedUrl> typedUrls;
+ private Set<TypedUrl> typedUrls;
/** The uid for the event. Generated by the system or by external sources when
* imported.
@@ -351,18 +351,18 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Collection)
+ * @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.CATEGORIES,
venueProperty = true)
- public void setCategories(Collection<BwCategory> val) {
+ public void setCategories(Set<BwCategory> val) {
categories = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#getCategories()
*/
- public Collection<BwCategory> getCategories() {
+ public Set<BwCategory> getCategories() {
return categories;
}
@@ -370,7 +370,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#getNumCategories()
*/
public int getNumCategories() {
- Collection<BwCategory> c = getCategories();
+ Set<BwCategory> c = getCategories();
if (c == null) {
return 0;
}
@@ -382,7 +382,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#addCategory(org.bedework.calfacade.BwCategory)
*/
public void addCategory(BwCategory val) {
- Collection<BwCategory> cats = getCategories();
+ Set<BwCategory> cats = getCategories();
if (cats == null) {
cats = new TreeSet<BwCategory>();
setCategories(cats);
@@ -397,7 +397,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#removeCategory(org.bedework.calfacade.BwCategory)
*/
public boolean removeCategory(BwCategory val) {
- Collection cats = getCategories();
+ Set cats = getCategories();
if (cats == null) {
return false;
}
@@ -409,7 +409,7 @@
* @see org.bedework.calfacade.base.CategorisedEntity#hasCategory(org.bedework.calfacade.BwCategory)
*/
public boolean hasCategory(BwCategory val) {
- Collection cats = getCategories();
+ Set cats = getCategories();
if (cats == null) {
return false;
}
@@ -420,7 +420,7 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#copyCategories()
*/
- public Collection<BwCategory> copyCategories() {
+ public Set<BwCategory> copyCategories() {
if (getNumCategories() == 0) {
return null;
}
@@ -436,7 +436,7 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#cloneCategories()
*/
- public Collection<BwCategory> cloneCategories() {
+ public Set<BwCategory> cloneCategories() {
if (getNumCategories() == 0) {
return null;
}
@@ -454,18 +454,18 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Collection)
+ * @see org.bedework.calfacade.base.DescriptionEntity#setDescriptions(java.util.Set)
*/
@IcalProperty(pindex = IcalPropertyIndex.DESCRIPTION,
venueProperty = true)
- public void setDescriptions(Collection<BwString> val) {
+ public void setDescriptions(Set<BwString> val) {
descriptions = val;
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.DescriptionEntity#getDescriptions()
*/
- public Collection<BwString> getDescriptions() {
+ public Set<BwString> getDescriptions() {
return descriptions;
}
@@ -473,7 +473,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#getNumDescriptions()
*/
public int getNumDescriptions() {
- Collection rs = getDescriptions();
+ Set rs = getDescriptions();
if (rs == null) {
return 0;
}
@@ -492,7 +492,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#addDescription(org.bedework.calfacade.BwString)
*/
public void addDescription(BwString val) {
- Collection<BwString> rs = getDescriptions();
+ Set<BwString> rs = getDescriptions();
if (rs == null) {
rs = new TreeSet<BwString>();
setDescriptions(rs);
@@ -507,7 +507,7 @@
* @see org.bedework.calfacade.base.DescriptionEntity#removeDescription(org.bedework.calfacade.BwString)
*/
public boolean removeDescription(BwString val) {
- Collection rs = getDescriptions();
+ Set rs = getDescriptions();
if (rs == null) {
return false;
}
@@ -528,7 +528,7 @@
} else if (s == null) {
addDescription(lang, val);
} else if ((CalFacadeUtil.cmpObjval(val, s.getValue()) != 0)) {
- // XXX Cannot change value in case this is an override collection.
+ // XXX Cannot change value in case this is an override Set.
//s.setValue(val);
removeDescription(s);
@@ -570,14 +570,14 @@
*/
@IcalProperty(pindex = IcalPropertyIndex.LOCATIONTYPES,
venueProperty = true)
- public void setLocationTypes(Collection<String> val) {
+ public void setLocationTypes(Set<String> val) {
locationTypes = val;
}
/**
- * @return Collection<TypedUrl>
+ * @return Set<TypedUrl>
*/
- public Collection<String> getLocationTypes() {
+ public Set<String> getLocationTypes() {
return locationTypes;
}
@@ -585,7 +585,7 @@
* @return int
*/
public int getNumLocationTypes() {
- Collection<String> c = getLocationTypes();
+ Set<String> c = getLocationTypes();
if (c == null) {
return 0;
}
@@ -597,7 +597,7 @@
* @param val
*/
public void addLocationType(String val) {
- Collection<String> c = getLocationTypes();
+ Set<String> c = getLocationTypes();
if (c == null) {
c = new TreeSet<String>();
setLocationTypes(c);
@@ -613,7 +613,7 @@
* @return boolean
*/
public boolean removeLocationType(String val) {
- Collection<String> c = getLocationTypes();
+ Set<String> c = getLocationTypes();
if (c == null) {
return false;
}
@@ -626,7 +626,7 @@
* @return boolean
*/
public boolean hasLocationType(String val) {
- Collection<String> c = getLocationTypes();
+ Set<String> c = getLocationTypes();
if (c == null) {
return false;
}
@@ -643,14 +643,14 @@
*/
@IcalProperty(pindex = IcalPropertyIndex.TYPEDURLS,
venueProperty = true)
- public void setTypedUrls(Collection<TypedUrl> val) {
+ public void setTypedUrls(Set<TypedUrl> val) {
typedUrls = val;
}
/**
- * @return Collection<TypedUrl>
+ * @return Set<TypedUrl>
*/
- public Collection<TypedUrl> getTypedUrls() {
+ public Set<TypedUrl> getTypedUrls() {
return typedUrls;
}
@@ -658,7 +658,7 @@
* @return int
*/
public int getNumTypedUrls() {
- Collection<TypedUrl> c = getTypedUrls();
+ Set<TypedUrl> c = getTypedUrls();
if (c == null) {
return 0;
}
@@ -670,7 +670,7 @@
* @param val
*/
public void addTypedUrl(TypedUrl val) {
- Collection<TypedUrl> urls = getTypedUrls();
+ Set<TypedUrl> urls = getTypedUrls();
if (urls == null) {
urls = new TreeSet<TypedUrl>();
setTypedUrls(urls);
@@ -686,7 +686,7 @@
* @return boolean
*/
public boolean removeTypedUrl(TypedUrl val) {
- Collection<TypedUrl> urls = getTypedUrls();
+ Set<TypedUrl> urls = getTypedUrls();
if (urls == null) {
return false;
}
@@ -699,7 +699,7 @@
* @return boolean
*/
public boolean hasTypedUrl(TypedUrl val) {
- Collection<TypedUrl> urls = getTypedUrls();
+ Set<TypedUrl> urls = getTypedUrls();
if (urls == null) {
return false;
}
@@ -708,9 +708,9 @@
}
/**
- * @return Collection<TypedUrl>
+ * @return Set<TypedUrl>
*/
- public Collection<TypedUrl> copyTypedUrl() {
+ public Set<TypedUrl> copyTypedUrl() {
if (getNumTypedUrls() == 0) {
return null;
}
Modified: trunk/calFacade/src/org/bedework/calfacade/base/AlarmsEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/AlarmsEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/AlarmsEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,24 +27,24 @@
import org.bedework.calfacade.BwAlarm;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more alarms will implement this interface.
*
* @author douglm
*/
public interface AlarmsEntity {
- /** Set the attendees collection
+ /** Set the attendees Set
*
- * @param val Collection of alarms
+ * @param val Set of alarms
*/
- public void setAlarms(Collection<BwAlarm> val);
+ public void setAlarms(Set<BwAlarm> val);
/** Get the attendees
*
- * @return Collection alarms list
+ * @return Set alarms list
*/
- public Collection<BwAlarm> getAlarms();
+ public Set<BwAlarm> getAlarms();
/**
* @return int number of alarms.
@@ -62,9 +62,9 @@
*/
public boolean removeAlarm(BwAlarm val);
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwAlarm
+ * @return Set of BwAlarm
*/
- public Collection<BwAlarm> cloneAlarms();
+ public Set<BwAlarm> cloneAlarms();
}
Modified: trunk/calFacade/src/org/bedework/calfacade/base/AttachmentsEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/AttachmentsEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/AttachmentsEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,24 +27,24 @@
import org.bedework.calfacade.BwAttachment;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more attachments will implement this interface.
*
* @author douglm
*/
public interface AttachmentsEntity {
- /** Set the attendees collection
+ /** Set the attendees Set
*
- * @param val Collection of attachments
+ * @param val Set of attachments
*/
- public void setAttachments(Collection<BwAttachment> val);
+ public void setAttachments(Set<BwAttachment> val);
/** Get the attendees
*
- * @return Collection attachments list
+ * @return Set attachments list
*/
- public Collection<BwAttachment> getAttachments();
+ public Set<BwAttachment> getAttachments();
/**
* @return int number of attachments.
@@ -62,15 +62,15 @@
*/
public boolean removeAttachment(BwAttachment val);
- /** Return a copy of the collection
+ /** Return a copy of the Set
*
- * @return Collection of BwAttachment
+ * @return Set of BwAttachment
*/
- public Collection<BwAttachment> copyAttachments();
+ public Set<BwAttachment> copyAttachments();
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwAttachment
+ * @return Set of BwAttachment
*/
- public Collection<BwAttachment> cloneAttachments();
+ public Set<BwAttachment> cloneAttachments();
}
Modified: trunk/calFacade/src/org/bedework/calfacade/base/AttendeesEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/AttendeesEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/AttendeesEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,7 +27,7 @@
import org.bedework.calfacade.BwAttendee;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more attendees will implement this interface.
*
@@ -36,17 +36,17 @@
* @author Mike Douglass
*/
public interface AttendeesEntity {
- /** Set the attendees collection
+ /** Set the attendees Set
*
- * @param val Collection of attendees
+ * @param val Set of attendees
*/
- public void setAttendees(Collection<BwAttendee> val);
+ public void setAttendees(Set<BwAttendee> val);
/** Get the attendees
*
- * @return Collection attendees list
+ * @return Set attendees list
*/
- public Collection<BwAttendee> getAttendees();
+ public Set<BwAttendee> getAttendees();
/**
* @return int number of attendees.
@@ -64,29 +64,29 @@
*/
public boolean removeAttendee(BwAttendee val);
- /** Return a copy of the collection
+ /** Return a copy of the Set
*
- * @return Collection of BwAttendee
+ * @return Set of BwAttendee
*/
- public Collection<BwAttendee> copyAttendees();
+ public Set<BwAttendee> copyAttendees();
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwAttendee
+ * @return Set of BwAttendee
*/
- public Collection<BwAttendee> cloneAttendees();
+ public Set<BwAttendee> cloneAttendees();
- /** Set the recipients collection
+ /** Set the recipients Set
*
- * @param val Collection of (String)recipients
+ * @param val Set of (String)recipients
*/
- public void setRecipients(Collection<String> val);
+ public void setRecipients(Set<String> val);
/** Get the recipients
*
- * @return Collection recipients set
+ * @return Set recipients set
*/
- public Collection<String> getRecipients();
+ public Set<String> getRecipients();
/**
* @return int number of recipients.
Modified: trunk/calFacade/src/org/bedework/calfacade/base/CategorisedEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/CategorisedEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/CategorisedEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,24 +27,24 @@
import org.bedework.calfacade.BwCategory;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more categories will implement this interface.
*
* @author douglm
*/
public interface CategorisedEntity {
- /** Set the categories collection
+ /** Set the categories Set
*
- * @param val Collection of categories
+ * @param val Set of categories
*/
- public void setCategories(Collection<BwCategory> val);
+ public void setCategories(Set<BwCategory> val);
/** Get the categories
*
- * @return Collection of categories
+ * @return Set of categories
*/
- public Collection<BwCategory> getCategories();
+ public Set<BwCategory> getCategories();
/**
* @return int number of categories.
@@ -69,15 +69,15 @@
*/
public boolean hasCategory(BwCategory val);
- /** Return a copy of the collection
+ /** Return a copy of the Set
*
- * @return Collection of BwCategory
+ * @return Set of BwCategory
*/
- public Collection<BwCategory> copyCategories();
+ public Set<BwCategory> copyCategories();
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwCategory
+ * @return Set of BwCategory
*/
- public Collection<BwCategory> cloneCategories();
+ public Set<BwCategory> cloneCategories();
}
Modified: trunk/calFacade/src/org/bedework/calfacade/base/CommentedEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/CommentedEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/CommentedEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,7 +27,7 @@
import org.bedework.calfacade.BwString;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more comments will implement this interface.
*
@@ -35,17 +35,17 @@
*/
public interface CommentedEntity {
- /** Set the comments collection
+ /** Set the comments Set
*
- * @param val Collection of (BwString)comments
+ * @param val Set of (BwString)comments
*/
- public void setComments(Collection<BwString> val);
+ public void setComments(Set<BwString> val);
/** Get the comments
*
- * @return Collection comments set
+ * @return Set comments set
*/
- public Collection<BwString> getComments();
+ public Set<BwString> getComments();
/**
* @return int number of comments.
Modified: trunk/calFacade/src/org/bedework/calfacade/base/ContactedEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/ContactedEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/ContactedEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,24 +27,24 @@
import org.bedework.calfacade.BwContact;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more contacts will implement this interface.
*
* @author douglm
*/
public interface ContactedEntity {
- /** Set the contacts collection
+ /** Set the contacts Set
*
- * @param val Collection of contacts
+ * @param val Set of contacts
*/
- public void setContacts(Collection<BwContact> val);
+ public void setContacts(Set<BwContact> val);
/** Get the contacts
*
- * @return Collection of contacts
+ * @return Set of contacts
*/
- public Collection<BwContact> getContacts();
+ public Set<BwContact> getContacts();
/**
* @return int number of contacts.
@@ -69,15 +69,15 @@
*/
public boolean hasContact(BwContact val);
- /** Return a copy of the collection
+ /** Return a copy of the Set
*
- * @return Collection of BwContact
+ * @return Set of BwContact
*/
- public Collection<BwContact> copyContacts();
+ public Set<BwContact> copyContacts();
- /** Return a clone of the collection
+ /** Return a clone of the Set
*
- * @return Collection of BwContact
+ * @return Set of BwContact
*/
- public Collection<BwContact> cloneContacts();
+ public Set<BwContact> cloneContacts();
}
Modified: trunk/calFacade/src/org/bedework/calfacade/base/DescriptionEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/DescriptionEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/DescriptionEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -25,7 +25,7 @@
*/
package org.bedework.calfacade.base;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more descriptions will implement this interface.
*
@@ -35,17 +35,17 @@
*/
public interface DescriptionEntity<T extends BwStringBase> {
- /** Set the descriptions collection
+ /** Set the descriptions Set
*
- * @param val Collection of (BwString)descriptions
+ * @param val Set of (BwString)descriptions
*/
- public void setDescriptions(Collection<T> val);
+ public void setDescriptions(Set<T> val);
/** Get the descriptions
*
- * @return Collection descriptions set
+ * @return Set descriptions set
*/
- public Collection<T> getDescriptions();
+ public Set<T> getDescriptions();
/**
* @return int number of descriptions.
Modified: trunk/calFacade/src/org/bedework/calfacade/base/OverrideCollection.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/OverrideCollection.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/OverrideCollection.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -54,24 +54,26 @@
*
* @author Mike Douglass douglm - rpi.edu
* @param <T>
+ * @param <C> Base Collection type, e.g List<T>
*/
-public abstract class OverrideCollection <T> implements Collection<T> {
+public abstract class OverrideCollection <T, C extends Collection<T>>
+ implements Collection<T> {
/** Set the override Collection
*
* @param val
*/
- public abstract void setOverrideCollection(Collection<T> val);
+ public abstract void setOverrideCollection(C val);
/** Get the override collection
* @return Collection<T>
*/
- public abstract Collection<T> getOverrideCollection();
+ public abstract C getOverrideCollection();
/** Get a new empty override collection
* @return empty Collection<T>
*/
- public abstract Collection<T> getEmptyOverrideCollection();
+ public abstract C getEmptyOverrideCollection();
/** Set the override is explicitly emptied.
*
@@ -88,7 +90,7 @@
/** Get the master collection
* @return the master Collection
*/
- public abstract Collection<T> getMasterCollection();
+ public abstract C getMasterCollection();
/* (non-Javadoc)
* @see java.util.Collection#size()
@@ -227,7 +229,7 @@
* @see java.util.Collection#addAll(java.util.Collection)
*/
public boolean addAll(Collection<? extends T> c){
- Collection<T> cc = getModCollection();
+ C cc = getModCollection();
setOverrideEmptyFlag(false);
return cc.addAll(c);
@@ -281,7 +283,7 @@
return getCollection().hashCode();
}
- private void setOverrideEmptyFlag(boolean val) {
+ protected void setOverrideEmptyFlag(boolean val) {
Boolean emptied = getOverrideIsEmpty();
if (val) {
@@ -297,8 +299,8 @@
/* Only call for read operations
*/
- private Collection<T> getCollection() {
- Collection<T> c = getOverrideCollection();
+ protected C getCollection() {
+ C c = getOverrideCollection();
if ((c != null) && !c.isEmpty()) {
return c;
@@ -312,8 +314,8 @@
return getMasterCollection();
}
- private Collection<T> getModCollection() {
- Collection<T> over = getOverrideCollection();
+ protected C getModCollection() {
+ C over = getOverrideCollection();
if ((over != null) && !over.isEmpty()) {
return over;
}
@@ -329,7 +331,7 @@
/* Copy master into new override.
*/
- Collection<T> mstr = getMasterCollection();
+ C mstr = getMasterCollection();
if (mstr != null) {
for (T el: mstr) {
Added: trunk/calFacade/src/org/bedework/calfacade/base/OverrideList.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/OverrideList.java (rev 0)
+++ trunk/calFacade/src/org/bedework/calfacade/base/OverrideList.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -0,0 +1,178 @@
+/* **********************************************************************
+ Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
+
+ Redistribution and use of this distribution in source and binary forms,
+ with or without modification, are permitted provided that:
+ The above copyright notice and this permission notice appear in all
+ copies and supporting documentation;
+
+ The name, identifiers, and trademarks of Rensselaer Polytechnic
+ Institute are not used in advertising or publicity without the
+ express prior written permission of Rensselaer Polytechnic Institute;
+
+ DISCLAIMER: The software is distributed" AS IS" without any express or
+ implied warranty, including but not limited to, any implied warranties
+ of merchantability or fitness for a particular purpose or any warrant)'
+ of non-infringement of any current or pending patent rights. The authors
+ of the software make no representations about the suitability of this
+ software for any particular purpose. The entire risk as to the quality
+ and performance of the software is with the user. Should the software
+ prove defective, the user assumes the cost of all necessary servicing,
+ repair or correction. In particular, neither Rensselaer Polytechnic
+ Institute, nor the authors of the software are liable for any indirect,
+ special, consequential, or incidental damages related to the software,
+ to the maximum extent the law permits.
+*/
+package org.bedework.calfacade.base;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.ListIterator;
+
+/** An override collection which is a List of T.
+ *
+ * @author Mike Douglass douglm - rpi.edu
+ * @param <T>
+ */
+public abstract class OverrideList <T> extends OverrideCollection <T,
+ List<T>>
+ implements List<T> {
+ /* (non-Javadoc)
+ * @see org.bedework.calfacade.base.OverrideCollection#getEmptyOverrideCollection()
+ */
+ public List<T> getEmptyOverrideCollection() {
+ return new ArrayList<T>();
+ }
+
+ /* ************************************************************************
+ * Collection methods
+ */
+
+ /* (non-Javadoc)
+ * @see java.util.Collection#addAll(java.util.Collection)
+ */
+ public boolean addAll(Collection<? extends T> c){
+ return super.addAll(c);
+ }
+
+ /* ************************************************************************
+ * List methods
+ */
+
+ /* (non-Javadoc)
+ * @see java.util.List#add(int, java.lang.Object)
+ */
+ public void add(int index, T element) {
+ List<T> cc = getModCollection();
+
+ setOverrideEmptyFlag(false);
+ cc.add(index, element);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#addAll(int, java.util.Collection)
+ */
+ public boolean addAll(int index, Collection<? extends T> c) {
+ List<T> cc = getModCollection();
+
+ setOverrideEmptyFlag(false);
+ return cc.addAll(index, c);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#get(int)
+ */
+ public T get(int index) {
+ List<T> c = getCollection();
+ if (c == null) {
+ return null;
+ }
+
+ return c.get(index);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#indexOf(java.lang.Object)
+ */
+ public int indexOf(Object o) {
+ List<T> c = getCollection();
+ if (c == null) {
+ return -1;
+ }
+
+ return c.indexOf(o);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#lastIndexOf(java.lang.Object)
+ */
+ public int lastIndexOf(Object o) {
+ List<T> c = getCollection();
+ if (c == null) {
+ return -1;
+ }
+
+ return c.lastIndexOf(o);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#listIterator()
+ */
+ public ListIterator<T> listIterator() {
+ List<T> c = getCollection();
+ if (c == null) {
+ return null;
+ }
+
+ return c.listIterator();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#listIterator(int)
+ */
+ public ListIterator<T> listIterator(int index) {
+ List<T> c = getCollection();
+ if (c == null) {
+ return null;
+ }
+
+ return c.listIterator(index);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#remove(int)
+ */
+ public T remove(int index) {
+ List<T> c = getCollection();
+ if (c == null) {
+ return null;
+ }
+
+ return c.remove(index);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.List#set(int, java.lang.Object)
+ */
+ public T set(int index, T element) {
+ List<T> cc = getModCollection();
+
+ setOverrideEmptyFlag(false);
+ return cc.set(index, element);
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.util.List#subList(int, int)
+ */
+ public List<T> subList(int fromIndex, int toIndex) {
+ List<T> c = getCollection();
+ if (c == null) {
+ return null;
+ }
+
+ return c.subList(fromIndex, toIndex);
+ }
+
+}
Property changes on: trunk/calFacade/src/org/bedework/calfacade/base/OverrideList.java
___________________________________________________________________
Name: svn:eol-style
+ LF
Added: trunk/calFacade/src/org/bedework/calfacade/base/OverrideSet.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/OverrideSet.java (rev 0)
+++ trunk/calFacade/src/org/bedework/calfacade/base/OverrideSet.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -0,0 +1,48 @@
+/* **********************************************************************
+ Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
+
+ Redistribution and use of this distribution in source and binary forms,
+ with or without modification, are permitted provided that:
+ The above copyright notice and this permission notice appear in all
+ copies and supporting documentation;
+
+ The name, identifiers, and trademarks of Rensselaer Polytechnic
+ Institute are not used in advertising or publicity without the
+ express prior written permission of Rensselaer Polytechnic Institute;
+
+ DISCLAIMER: The software is distributed" AS IS" without any express or
+ implied warranty, including but not limited to, any implied warranties
+ of merchantability or fitness for a particular purpose or any warrant)'
+ of non-infringement of any current or pending patent rights. The authors
+ of the software make no representations about the suitability of this
+ software for any particular purpose. The entire risk as to the quality
+ and performance of the software is with the user. Should the software
+ prove defective, the user assumes the cost of all necessary servicing,
+ repair or correction. In particular, neither Rensselaer Polytechnic
+ Institute, nor the authors of the software are liable for any indirect,
+ special, consequential, or incidental damages related to the software,
+ to the maximum extent the law permits.
+*/
+package org.bedework.calfacade.base;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+/** An override collection which is a Set of T.
+ *
+ * @author Mike Douglass douglm - rpi.edu
+ * @param <T>
+ */
+public abstract class OverrideSet <T> extends OverrideCollection <T,
+ Set<T>>
+ implements Set<T> {
+ /* (non-Javadoc)
+ * @see org.bedework.calfacade.base.OverrideCollection#getEmptyOverrideCollection()
+ */
+ /* (non-Javadoc)
+ * @see org.bedework.calfacade.base.OverrideCollection#getEmptyOverrideCollection()
+ */
+ public Set<T> getEmptyOverrideCollection() {
+ return new TreeSet<T>();
+ }
+}
Property changes on: trunk/calFacade/src/org/bedework/calfacade/base/OverrideSet.java
___________________________________________________________________
Name: svn:eol-style
+ LF
Modified: trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -29,7 +29,7 @@
import org.bedework.calfacade.BwDateTime;
import java.io.Serializable;
-import java.util.Collection;
+import java.util.Set;
/**
* @author Mike Douglass douglm - rpi.edu
@@ -61,42 +61,42 @@
/**
* @param val
*/
- public void setRrules(Collection<String> val);
+ public void setRrules(Set<String> val);
/**
- * @return Collection of String
+ * @return Set of String
*/
- public Collection<String> getRrules();
+ public Set<String> getRrules();
/**
* @param val
*/
- public void setExrules(Collection<String> val);
+ public void setExrules(Set<String> val);
/**
- * @return Collection of String
+ * @return Set of String
*/
- public Collection<String> getExrules();
+ public Set<String> getExrules();
/**
* @param val
*/
- public void setRdates(Collection<BwDateTime> val);
+ public void setRdates(Set<BwDateTime> val);
/**
- * @return Collection of String
+ * @return Set of String
*/
- public Collection<BwDateTime> getRdates();
+ public Set<BwDateTime> getRdates();
/**
* @param val
*/
- public void setExdates(Collection<BwDateTime> val);
+ public void setExdates(Set<BwDateTime> val);
/**
- * @return Collection of String
+ * @return Set of String
*/
- public Collection<BwDateTime> getExdates();
+ public Set<BwDateTime> getExdates();
/**
* @param val
Modified: trunk/calFacade/src/org/bedework/calfacade/base/ResourcedEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/ResourcedEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/ResourcedEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,7 +27,7 @@
import org.bedework.calfacade.BwString;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more resources will implement this interface.
*
@@ -35,17 +35,17 @@
*/
public interface ResourcedEntity {
- /** Set the resources collection
+ /** Set the resources Set
*
- * @param val Collection of (BwString)resources
+ * @param val Set of (BwString)resources
*/
- public void setResources(Collection<BwString> val);
+ public void setResources(Set<BwString> val);
/** Get the resources
*
- * @return Collection resources set
+ * @return Set resources set
*/
- public Collection<BwString> getResources();
+ public Set<BwString> getResources();
/**
* @return int number of resources.
Modified: trunk/calFacade/src/org/bedework/calfacade/base/SummaryEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/SummaryEntity.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/base/SummaryEntity.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -27,7 +27,7 @@
import org.bedework.calfacade.BwString;
-import java.util.Collection;
+import java.util.Set;
/** An entity that can have one or more summaries will implement this interface.
*
@@ -35,17 +35,17 @@
*/
public interface SummaryEntity {
- /** Set the summaries collection
+ /** Set the summaries Set
*
- * @param val Collection of (BwString)summaries
+ * @param val Set of (BwString)summaries
*/
- public void setSummaries(Collection<BwString> val);
+ public void setSummaries(Set<BwString> val);
/** Get the summaries
*
- * @return Collection summaries set
+ * @return Set summaries set
*/
- public Collection<BwString> getSummaries();
+ public Set<BwString> getSummaries();
/**
* @return int number of summaries.
Modified: trunk/calFacade/src/org/bedework/calfacade/util/ChangeTable.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/util/ChangeTable.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/util/ChangeTable.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -38,6 +38,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
+import java.util.Set;
import java.util.TreeSet;
/** Class to track changes to calendar entities. CalDAV (and file uploads)
@@ -429,42 +430,42 @@
case ATTACH:
originalVals = ev.getAttachments();
if (checkMulti(ent, originalVals, update)) {
- ev.setAttachments(ent.addedValues);
+ ev.setAttachments((Set)ent.addedValues);
}
break;
case ATTENDEE:
originalVals = ev.getAttendees();
if (checkMulti(ent, originalVals, update)) {
- ev.setAttendees(ent.addedValues);
+ ev.setAttendees((Set)ent.addedValues);
}
break;
case CATEGORIES:
originalVals = ev.getCategories();
if (checkMulti(ent, originalVals, update)) {
- ev.setCategories(ent.addedValues);
+ ev.setCategories((Set)ent.addedValues);
}
break;
case COMMENT:
originalVals = ev.getComments();
if (checkMulti(ent, originalVals, update)) {
- ev.setComments(ent.addedValues);
+ ev.setComments((Set)ent.addedValues);
}
break;
case CONTACT:
originalVals = ev.getContacts();
if (checkMulti(ent, originalVals, update)) {
- ev.setContacts(ent.addedValues);
+ ev.setContacts((Set)ent.addedValues);
}
break;
case REQUEST_STATUS:
originalVals = ev.getRequestStatuses();
if (checkMulti(ent, originalVals, update)) {
- ev.setRequestStatuses(ent.addedValues);
+ ev.setRequestStatuses((Set)ent.addedValues);
}
break;
@@ -474,21 +475,21 @@
case RESOURCES:
originalVals = ev.getResources();
if (checkMulti(ent, originalVals, update)) {
- ev.setResources(ent.addedValues);
+ ev.setResources((Set)ent.addedValues);
}
break;
case VALARM:
originalVals = ev.getAlarms();
if (checkMulti(ent, originalVals, update)) {
- ev.setAlarms(ent.addedValues);
+ ev.setAlarms((Set)ent.addedValues);
}
break;
case XPROP:
originalVals = ev.getXproperties();
if (checkMulti(ent, originalVals, update)) {
- ev.setXproperties(ent.addedValues);
+ ev.setXproperties((List)ent.addedValues);
}
break;
@@ -497,28 +498,28 @@
case EXDATE:
originalVals = ev.getExdates();
if (checkMulti(ent, originalVals, update)) {
- ev.setExdates(ent.addedValues);
+ ev.setExdates((Set)ent.addedValues);
}
break;
case EXRULE:
originalVals = ev.getExrules();
if (checkMulti(ent, originalVals, update)) {
- ev.setExrules(ent.addedValues);
+ ev.setExrules((Set)ent.addedValues);
}
break;
case RDATE:
originalVals = ev.getRdates();
if (checkMulti(ent, originalVals, update)) {
- ev.setRdates(ent.addedValues);
+ ev.setRdates((Set)ent.addedValues);
}
break;
case RRULE:
originalVals = ev.getRrules();
if (checkMulti(ent, originalVals, update)) {
- ev.setRrules(ent.addedValues);
+ ev.setRrules((Set)ent.addedValues);
}
break;
}
@@ -606,21 +607,21 @@
case CATEGORIES:
originalVals = val.getCategories();
if (checkMulti(ent, originalVals, update)) {
- val.setCategories(ent.addedValues);
+ val.setCategories((Set)ent.addedValues);
}
break;
case LOCATIONTYPES:
originalVals = val.getLocationTypes();
if (checkMulti(ent, originalVals, update)) {
- val.setLocationTypes(ent.addedValues);
+ val.setLocationTypes((Set)ent.addedValues);
}
break;
case TYPEDURLS:
originalVals = val.getTypedUrls();
if (checkMulti(ent, originalVals, update)) {
- val.setTypedUrls(ent.addedValues);
+ val.setTypedUrls((Set)ent.addedValues);
}
break;
}
Modified: trunk/calFacade/src/org/bedework/calfacade/wrappers/CalendarWrapper.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/wrappers/CalendarWrapper.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calFacade/src/org/bedework/calfacade/wrappers/CalendarWrapper.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -35,6 +35,7 @@
import edu.rpi.cmt.access.Acl.CurrentAccess;
import java.util.Collection;
+import java.util.Set;
/** An object to wrap a calendar entity in Bedework. This allows us to limit
* access to methods and attach thread or session information to the entity.
@@ -400,14 +401,14 @@
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#setCategories(java.util.Collection)
*/
- public void setCategories(Collection<BwCategory> val) {
+ public void setCategories(Set<BwCategory> val) {
entity.setCategories(val);
}
/* (non-Javadoc)
* @see org.bedework.calfacade.base.CategorisedEntity#getCategories()
*/
- public Collection<BwCategory> getCategories() {
+ public Set<BwCategory> getCategories() {
return entity.getCategories();
}
Modified: trunk/calsvc/src/org/bedework/calsvc/Scheduling.java
===================================================================
--- trunk/calsvc/src/org/bedework/calsvc/Scheduling.java 2008-04-14 19:09:50 UTC (rev 593)
+++ trunk/calsvc/src/org/bedework/calsvc/Scheduling.java 2008-04-20 04:38:53 UTC (rev 594)
@@ -82,6 +82,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import java.util.TreeSet;
/**
@@ -169,7 +170,7 @@
true, outAccess).cal;
}
- Collection<String> externalRcs = sendSchedule(sr, ei, recipient);
+ Set<String> externalRcs = sendSchedule(sr, ei, recipient);
if ((sr.errorCode != null) || sr.ignored) {
return sr;
@@ -630,7 +631,7 @@
BwCalendar outBox = gscr.cal;
- Collection<String> externalRcs = sendSchedule(sr, ei, null);
+ Set<String> externalRcs = sendSchedule(sr, ei, null);
if (sr.ignored) {
return sr;
@@ -1165,11 +1166,11 @@
/* Send the meeting request. If recipient is non-null send only to that recipient
* (used for REFRESH handling), otherwise send to recipients in event.
*/
- private Collection<String> sendSchedule(ScheduleResult sr,
- EventInfo ei,
- String recipient) throws CalFacadeException {
+ private Set<String> sendSchedule(ScheduleResult sr,
+ EventInfo ei,
+ String recipient) throws CalFacadeException {
/* Recipients external to the system. */
- Collection<String> externalRcs = null;
+ Set<String> externalRcs = null;
BwEvent ev = ei.getEvent();
boolean freeBusyRequest = ev.getEntityType() ==
CalFacadeDefs.entityTypeFreeAndBusy;
@@ -1259,7 +1260,7 @@
BwEvent ev = ei.getEvent();
boolean freeBusyRequest = ev.getEntityType() == CalFacadeDefs.entityTypeFreeAndBusy;
- Collection<String> recipients = null;
+ Set<String> recipients = null;
/*
class Request {
@@ -1284,7 +1285,7 @@
if (hi.getSupportsBedework() ||
hi.getSupportsCaldav() ||
hi.getSupportsRealtime()) {
- recipients = new ArrayList<String>();;
+ recipients = new TreeSet<String>();;
}
}
@@ -1359,11 +1360,11 @@
return calDav;
}
- private Collection<String> getRecipientInbox(String recip,
- ScheduleResult sr,
- Collection<String> externalRcs,
- boolean freeBusyRequest)
- throws CalFacadeException {
+ private Set<String> getRecipientInbox(String recip,
+ ScheduleResult sr,
+ Set<String> externalRcs,
+ boolean freeBusyRequest)
+ throws CalFacadeException {
UserInbox ui = getInbox(recip, freeBusyRequest);
if (ui.status == ScheduleRecipientResult.scheduleDeferred) {
@@ -1779,7 +1780,7 @@
}
private void addToOutBox(EventInfo ei, BwCalendar outBox,
- Collection<String> externalRcs) throws CalFacadeException {
+ Set<String> externalRcs) throws CalFacadeException {
// We have external recipients. Put in the outbox for mailing
EventInfo outEi = copyEventInfo(ei, getUser());
More information about the Bedework-commit
mailing list