本文整理汇总了Java中biweekly.property.ExceptionDates类的典型用法代码示例。如果您正苦于以下问题:Java ExceptionDates类的具体用法?Java ExceptionDates怎么用?Java ExceptionDates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExceptionDates类属于biweekly.property包,在下文中一共展示了ExceptionDates类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: _prepareParameters
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Override
protected ICalParameters _prepareParameters(ExceptionDates property, WriteContext context) {
if (isInObservance(context)) {
return property.getParameters();
}
boolean hasTime;
if (property.getValues().isEmpty()) {
hasTime = false;
} else {
hasTime = (dataType(property, context.getVersion()) == DATE_TIME);
}
return handleTzidParameter(property, hasTime, context);
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:15,代码来源:ExceptionDatesScribe.java
示例2: _dataType
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Override
protected ICalDataType _dataType(ExceptionDates property, ICalVersion version) {
List<ICalDate> dates = property.getValues();
if (!dates.isEmpty()) {
return dates.get(0).hasTime() ? DATE_TIME : DATE;
}
return defaultDataType(version);
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:10,代码来源:ExceptionDatesScribe.java
示例3: writeValue
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Override
protected String writeValue(ExceptionDates property, ICalDate value, WriteContext context) {
if (isInObservance(context)) {
return date(value).observance(true).extended(false).write();
}
return date(value, property, context).extended(false).write();
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:9,代码来源:ExceptionDatesScribe.java
示例4: readValue
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Override
protected ICalDate readValue(ExceptionDates property, String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
ICalDate date;
try {
boolean hasTime = (dataType == DATE_TIME);
date = date(value).hasTime(hasTime).parse();
} catch (IllegalArgumentException e) {
throw new CannotParseException(19);
}
context.addDate(date, property, parameters);
return date;
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:14,代码来源:ExceptionDatesScribe.java
示例5: _parseJson
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Override
protected ExceptionDates _parseJson(JCalValue value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
List<String> valueStrs = value.asMulti();
ExceptionDates property = new ExceptionDates();
List<ICalDate> values = property.getValues();
for (String valueStr : valueStrs) {
ICalDate date = readValue(property, valueStr, dataType, parameters, context);
values.add(date);
}
return property;
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:13,代码来源:ExceptionDatesScribe.java
示例6: getDateIterator
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Test
public void getDateIterator() {
TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
VEvent event = new VEvent();
event.setDateStart(date("2016-03-25 14:00:00", tz));
event.setRecurrenceRule(new Recurrence.Builder(Frequency.DAILY).count(10).build());
RecurrenceDates rdate = new RecurrenceDates();
rdate.getDates().add(new ICalDate(date("2016-03-26 20:00:00", tz)));
rdate.getDates().add(new ICalDate(date("2016-03-27 20:00:00", tz)));
event.addRecurrenceDates(rdate);
ExceptionDates exdate = new ExceptionDates();
exdate.getValues().add(new ICalDate(date("2016-03-27 14:00:00", tz)));
event.addExceptionDates(exdate);
ExceptionRule exrule = new ExceptionRule(new Recurrence.Builder(Frequency.WEEKLY).count(2).build());
event.addProperty(exrule);
//@formatter:off
List<Date> expectedList = Arrays.asList(
date("2016-03-26 14:00:00", tz),
date("2016-03-26 20:00:00", tz),
date("2016-03-27 20:00:00", tz),
date("2016-03-28 14:00:00", tz),
date("2016-03-29 14:00:00", tz),
date("2016-03-30 14:00:00", tz),
date("2016-03-31 14:00:00", tz),
date("2016-04-02 14:00:00", tz),
date("2016-04-03 14:00:00", tz)
);
//@formatter:on
assertIteratorEquals(expectedList, Google2445Utils.getDateIterator(event, TimeZone.getTimeZone("UTC")));
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:39,代码来源:Google2445UtilsTest.java
示例7: has
import biweekly.property.ExceptionDates; //导入依赖的package包/类
private final Check<ExceptionDates> has(final ICalDate... dates) {
return new Check<ExceptionDates>() {
public void check(ExceptionDates actual, ParseContext context) {
assertEquals(Arrays.asList(dates), actual.getValues());
}
};
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:8,代码来源:ExceptionDatesScribeTest.java
示例8: is
import biweekly.property.ExceptionDates; //导入依赖的package包/类
private final Check<ExceptionDates> is(final ExceptionDates expected) {
return new Check<ExceptionDates>() {
public void check(ExceptionDates actual, ParseContext context) {
assertEquals(expected.getValues(), actual.getValues());
}
};
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:8,代码来源:ExceptionDatesScribeTest.java
示例9: dateTimeWithTimezone
import biweekly.property.ExceptionDates; //导入依赖的package包/类
private Check<ExceptionDates> dateTimeWithTimezone(final boolean extended) {
return new Check<ExceptionDates>() {
public void check(ExceptionDates property, ParseContext context) {
assertEquals(0, context.getFloatingDates().size());
ListMultimap<String, TimezonedDate> timezonedDates = context.getTimezonedDates();
assertEquals(1, timezonedDates.keySet().size());
List<TimezonedDate> dates = context.getTimezonedDates().get("id");
assertEquals(2, dates.size());
assertTrue(dates.contains(new TimezonedDate(icalDate("2014-10-26T12:00:00"), property)));
assertTrue(dates.contains(new TimezonedDate(icalDate("2014-10-26T14:00:00"), property)));
}
};
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:15,代码来源:ExceptionDatesScribeTest.java
示例10: dateTimeWithoutTimezone
import biweekly.property.ExceptionDates; //导入依赖的package包/类
private Check<ExceptionDates> dateTimeWithoutTimezone(final boolean extended) {
return new Check<ExceptionDates>() {
public void check(ExceptionDates property, ParseContext context) {
Collection<TimezonedDate> floating = context.getFloatingDates();
assertEquals(2, floating.size());
assertTrue(floating.contains(new TimezonedDate(icalDate("2014-10-26T12:00:00"), property)));
assertTrue(floating.contains(new TimezonedDate(icalDate("2014-10-26T14:00:00"), property)));
assertEquals(0, context.getTimezonedDates().size());
}
};
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:13,代码来源:ExceptionDatesScribeTest.java
示例11: extractExceptionDates
import biweekly.property.ExceptionDates; //导入依赖的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;
}
开发者ID:DHBWLoerrach,项目名称:campus-app,代码行数:18,代码来源:ICalHelper.java
示例12: buildExdate
import biweekly.property.ExceptionDates; //导入依赖的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 "";
}
开发者ID:DHBWLoerrach,项目名称:campus-app,代码行数:34,代码来源:ICalHelper.java
示例13: ExceptionDatesScribe
import biweekly.property.ExceptionDates; //导入依赖的package包/类
public ExceptionDatesScribe() {
super(ExceptionDates.class, "EXDATE");
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:4,代码来源:ExceptionDatesScribe.java
示例14: newInstance
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@Override
protected ExceptionDates newInstance(ICalDataType dataType, ICalParameters parameters) {
return new ExceptionDates();
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:5,代码来源:ExceptionDatesScribe.java
示例15: parseExceptionDates
import biweekly.property.ExceptionDates; //导入依赖的package包/类
protected List<ExceptionDates> parseExceptionDates(String property, TimeZone tz) throws ParseException {
RDateList exDateList = new RDateList(property, tz);
Calendar calUtc = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
ExceptionDates exDates = new ExceptionDates();
for (DateValue exDate: exDateList.getDatesUtc()) {
calUtc.clear();
calUtc.set(exDate.year(), exDate.month(), exDate.day());
exDates.addValue(calUtc.getTime());
}
List<ExceptionDates> listExDates = new ArrayList<ExceptionDates>();
listExDates.add(exDates);
return listExDates;
}
开发者ID:eXfio,项目名称:CucumberSync,代码行数:20,代码来源:LocalCalendar.java
示例16: toVEventObject
import biweekly.property.ExceptionDates; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public VEvent toVEventObject() {
VEvent event = new VEvent();
if (uid != null)
event.setUid(uid);
event.setDateStart(dtStart);
if (dtEnd != null)
event.setDateEnd(dtEnd);
if (duration != null)
event.setDuration(duration);
if (rrule != null)
event.setRecurrenceRule(rrule);
if (rdate != null && !rdate.isEmpty()) {
for (RecurrenceDates rd : rdate) {
event.addRecurrenceDates(rd);
}
}
if (exrule != null && !exrule.isEmpty()) {
for (ExceptionRule exr : exrule) {
event.addExceptionRule(exr);
}
}
if (exdate != null && !exdate.isEmpty()) {
for (ExceptionDates exd: exdate) {
event.addExceptionDates(exd);
}
}
if (summary != null && !summary.isEmpty())
event.setSummary(summary);
if (location != null && !location.isEmpty())
event.setLocation(location);
if (description != null && !description.isEmpty())
event.setDescription(description);
if (status != null)
event.setStatus(status);
if (!opaque)
event.setTransparency(true);
if (organizer != null)
event.setOrganizer(organizer);
for (Attendee attendee: attendees) {
event.addAttendee(attendee);
}
if (forPublic != null)
event.setClassification(forPublic ? "public" : "private");
for (VAlarm alarm: alarms) {
event.addAlarm(alarm);
}
event.setLastModified(new Date());
return event;
}
开发者ID:eXfio,项目名称:CucumberSync,代码行数:63,代码来源:Event.java
示例17: getExceptionDates
import biweekly.property.ExceptionDates; //导入依赖的package包/类
/**
* Gets the list of exceptions to the recurrence rule defined in the to-do
* task (if one is defined).
* @return the list of exceptions (any changes made this list will affect
* the parent component object and vice versa)
* @see <a href="http://tools.ietf.org/html/rfc5545#page-118">RFC 5545
* p.118-20</a>
* @see <a href="http://tools.ietf.org/html/rfc2445#page-112">RFC 2445
* p.112-4</a>
* @see <a href="http://www.imc.org/pdi/vcal-10.doc">vCal 1.0 p.31</a>
*/
public List<ExceptionDates> getExceptionDates() {
return getProperties(ExceptionDates.class);
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:15,代码来源:VTodo.java
示例18: addExceptionDates
import biweekly.property.ExceptionDates; //导入依赖的package包/类
/**
* Adds a list of exceptions to the recurrence rule defined in the to-do
* task (if one is defined). Note that this property can contain multiple
* dates.
* @param exceptionDates the list of exceptions
* @see <a href="http://tools.ietf.org/html/rfc5545#page-118">RFC 5545
* p.118-20</a>
* @see <a href="http://tools.ietf.org/html/rfc2445#page-112">RFC 2445
* p.112-4</a>
* @see <a href="http://www.imc.org/pdi/vcal-10.doc">vCal 1.0 p.31</a>
*/
public void addExceptionDates(ExceptionDates exceptionDates) {
addProperty(exceptionDates);
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:15,代码来源:VTodo.java
示例19: getExceptionDates
import biweekly.property.ExceptionDates; //导入依赖的package包/类
/**
* Gets the list of exceptions to the recurrence rule defined in the journal
* entry (if one is defined).
* @return the list of exceptions (any changes made this list will affect
* the parent component object and vice versa)
* @see <a href="http://tools.ietf.org/html/rfc5545#page-118">RFC 5545
* p.118-20</a>
* @see <a href="http://tools.ietf.org/html/rfc2445#page-112">RFC 2445
* p.112-4</a>
*/
public List<ExceptionDates> getExceptionDates() {
return getProperties(ExceptionDates.class);
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:14,代码来源:VJournal.java
示例20: addExceptionDates
import biweekly.property.ExceptionDates; //导入依赖的package包/类
/**
* Adds a list of exceptions to the recurrence rule defined in the journal
* entry (if one is defined). Note that this property can contain multiple
* dates.
* @param exceptionDates the list of exceptions
* @see <a href="http://tools.ietf.org/html/rfc5545#page-118">RFC 5545
* p.118-20</a>
* @see <a href="http://tools.ietf.org/html/rfc2445#page-112">RFC 2445
* p.112-4</a>
*/
public void addExceptionDates(ExceptionDates exceptionDates) {
addProperty(exceptionDates);
}
开发者ID:mangstadt,项目名称:biweekly,代码行数:14,代码来源:VJournal.java
注:本文中的biweekly.property.ExceptionDates类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论