本文整理汇总了Java中biweekly.component.VEvent.getClassification方法的典型用法代码示例。如果您正苦于以下问题:Java VEvent.getClassification方法的具体用法?Java VEvent.getClassification怎么用?Java VEvent.getClassification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类biweekly.component.VEvent
的用法示例。
在下文中一共展示了VEvent.getClassification方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: perpareValues
import biweekly.component.VEvent; //导入方法依赖的package包/类
private ContentValues perpareValues(long calendarId, VEvent e, TimeZone tz) {
ContentValues values = new ContentValues();
String hash = ICalHelper.calcEventHash(e);
values.put(Events.CALENDAR_ID, calendarId);
values.put(Events.TITLE, e.getSummary().getValue());
values.put(Events.DTSTART, e.getDateStart().getValue().getTime());
values.put(Events.DTEND, e.getDateEnd().getValue().getTime());
values.put(Events._SYNC_ID, e.getUid().getValue());
values.put(EVENTS_DB_TIME_STEMP_COLUMN, Long.toString(e.getDateTimeStamp().getValue().getTime()));
values.put(EVENTS_DB_HASH_COLUMN, hash);
if (e.getClassification() != null)
if (e.getClassification().isPrivate())
values.put(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);
else
values.put(Events.ACCESS_LEVEL, Events.ACCESS_PUBLIC);
else
values.put(Events.ACCESS_LEVEL, Events.ACCESS_DEFAULT);
if (e.getDescription() != null)
values.put(Events.DESCRIPTION, e.getDescription().getValue());
if (e.getLocation() != null)
values.put(Events.EVENT_LOCATION, e.getLocation().getValue());
values.put(Events.EVENT_TIMEZONE, tz.getID());
return values;
}
示例2: 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();
}