当前位置: 首页>>代码示例>>Java>>正文


Java VEvent.getRecurrenceRule方法代码示例

本文整理汇总了Java中biweekly.component.VEvent.getRecurrenceRule方法的典型用法代码示例。如果您正苦于以下问题:Java VEvent.getRecurrenceRule方法的具体用法?Java VEvent.getRecurrenceRule怎么用?Java VEvent.getRecurrenceRule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在biweekly.component.VEvent的用法示例。


在下文中一共展示了VEvent.getRecurrenceRule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
}
 
开发者ID:eXfio,项目名称:CucumberSync,代码行数:62,代码来源:Event.java


注:本文中的biweekly.component.VEvent.getRecurrenceRule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。