本文整理汇总了Java中biweekly.component.VEvent.getExceptionDates方法的典型用法代码示例。如果您正苦于以下问题:Java VEvent.getExceptionDates方法的具体用法?Java VEvent.getExceptionDates怎么用?Java VEvent.getExceptionDates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类biweekly.component.VEvent
的用法示例。
在下文中一共展示了VEvent.getExceptionDates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractExceptionDates
import biweekly.component.VEvent; //导入方法依赖的package包/类
/**
* extract the exception dates
*
* @param e
* @return
*/
private static List<Date> extractExceptionDates(VEvent e) {
List<Date> dateList = new ArrayList<Date>();
List<ExceptionDates> exceptionDates = e.getExceptionDates();
if (exceptionDates != null) {
for (ExceptionDates ed : exceptionDates) {
dateList.addAll(ed.getValues());
}
}
return dateList;
}
示例2: buildExdate
import biweekly.component.VEvent; //导入方法依赖的package包/类
/**
* @param VEvent
* event
* @param TimeZone
* tz
* @return
*/
private static String buildExdate(VEvent event, TimeZone tz) {
List<ExceptionDates> exceptionDates = event.getExceptionDates();
if (exceptionDates != null) {
StringBuilder sb = new StringBuilder();
List<Date> dates = extractExceptionDates(event);
if (tz != null) {
sb.append("TZID=").append(tz.getID()).append(':');
}
for (Iterator<Date> iterator = dates.iterator(); iterator.hasNext();) {
Date date = (Date) iterator.next();
sb.append(parseIcalDateToString(date, tz));
if (iterator.hasNext()) {
sb.append(",");
}
}
return sb.toString();
}
return "";
}
示例3: fromVEventObject
import biweekly.component.VEvent; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void fromVEventObject(VEvent event) throws InvalidResourceException {
Log.d(TAG, "fromVEventObject()");
if (event.getUid() != null)
uid = event.getUid().getValue();
else {
Log.w(TAG, "Received VEVENT without UID, generating new one");
generateUID();
}
dtStart = event.getDateStart();
dtEnd = event.getDateEnd();
duration = event.getDuration();
if (dtStart == null || (dtEnd == null && duration == null))
throw new InvalidResourceException("Invalid start time/end time/duration");
// all-day events and "events on that day":
// * related UNIX times must be in UTC
// * must have a duration (set to one day if missing)
if (!dtStart.getValue().hasTime() && !dtEnd.getValue().after(dtStart.getValue())) {
Log.i(TAG, "Repairing iCal: DTEND := DTSTART+1");
Calendar c = Calendar.getInstance(TimeZone.getTimeZone(Time.TIMEZONE_UTC));
c.setTime(dtStart.getValue());
c.add(Calendar.DATE, 1);
dtEnd.setValue(new Date(c.getTimeInMillis()), false);
}
Log.d(TAG, "dtstart: " + dtStart.getValue().toString());
Log.d(TAG, "dtend: " + (dtEnd == null ? null : dtEnd.getValue().toString()));
Log.d(TAG, "duration: " + (duration == null ? null : duration.getValue().toString()));
rrule = event.getRecurrenceRule();
rdate = event.getRecurrenceDates();
exrule = event.getExceptionRules();
exdate = event.getExceptionDates();
if (event.getSummary() != null)
summary = event.getSummary().getValue();
if (event.getLocation() != null)
location = event.getLocation().getValue();
if (event.getDescription() != null)
description = event.getDescription().getValue();
status = event.getStatus();
opaque = true;
if (event.getTransparency() == Transparency.transparent())
opaque = false;
organizer = event.getOrganizer();
attendees = event.getAttendees();
forPublic = false;
if (event.getClassification() != null && event.getClassification().isPublic()) {
forPublic = true;
}
this.alarms = event.getAlarms();
}