/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
public FreeBusy build() { final FreeBusy fb = new FreeBusy(); fb.getParameters().add(FbType.FREE); final PeriodList periods = getConsumedTime(components, start, end); final DateRange range = new DateRange(start, end);
fb.getParameters().add(FbType.BUSY); vfb.getProperties().add(fb); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
fb.getParameters().add(FbType.BUSY); vfb.getProperties().add(fb); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
for(FreeBusy fb : props) { FbType fbt = (FbType) fb.getParameters().getParameter(Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) { busyPeriods.addAll(fb.getPeriods()); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
for(FreeBusy fb : props) { FbType fbt = (FbType) fb.getParameters().getParameter(Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) { busyPeriods.addAll(fb.getPeriods()); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
public FreeBusy build() { final FreeBusy fb = new FreeBusy(); fb.getParameters().add(FbType.FREE); final PeriodList periods = getConsumedTime(components, start, end); final DateRange range = new DateRange(start, end); // Add final consumed time to avoid special-case end-of-list processing periods.add(new Period(end, end)); DateTime lastPeriodEnd = new DateTime(start); // where no time is consumed set the last period end as the range start.. for (final Period period : periods) { // check if period outside bounds.. or period intersects with the end of the range.. if (range.contains(period) || (range.intersects(period) && period.getStart().after(range.getRangeStart()))) { // calculate duration between this period start and last period end.. final Duration freeDuration = new Duration(lastPeriodEnd, period.getStart()); if (freeDuration.getDuration().compareTo(duration) >= 0) { fb.getPeriods().add(new Period(lastPeriodEnd, freeDuration.getDuration())); } } if (period.getEnd().after(lastPeriodEnd)) { lastPeriodEnd = period.getEnd(); } } return fb; } }
FbType fbt = (FbType) fb.getParameters().getParameter( Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) {
public FreeBusy build() { final FreeBusy fb = new FreeBusy(); fb.getParameters().add(FbType.FREE); final PeriodList periods = getConsumedTime(components, start, end); final DateRange range = new DateRange(start, end); // Add final consumed time to avoid special-case end-of-list processing periods.add(new Period(end, end)); DateTime lastPeriodEnd = new DateTime(start); // where no time is consumed set the last period end as the range start.. for (final Period period : periods) { // check if period outside bounds.. or period intersects with the end of the range.. if (range.contains(period) || (range.intersects(period) && period.getStart().after(range.getRangeStart()))) { // calculate duration between this period start and last period end.. final Duration freeDuration = new Duration(lastPeriodEnd, period.getStart()); if (freeDuration.getDuration().compareTo(duration) >= 0) { fb.getPeriods().add(new Period(lastPeriodEnd, freeDuration.getDuration())); } } if (period.getEnd().after(lastPeriodEnd)) { lastPeriodEnd = period.getEnd(); } } return fb; } }
FbType fbt = (FbType) fb.getParameters().getParameter( Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) {
public FreeBusy build() { final FreeBusy fb = new FreeBusy(); fb.getParameters().add(FbType.FREE); final PeriodList periods = getConsumedTime(components, start, end); final DateRange range = new DateRange(start, end); // Add final consumed time to avoid special-case end-of-list processing periods.add(new Period(end, end)); DateTime lastPeriodEnd = new DateTime(start); // where no time is consumed set the last period end as the range start.. for (final Period period : periods) { // check if period outside bounds.. or period intersects with the end of the range.. if (range.contains(period) || (range.intersects(period) && period.getStart().after(range.getRangeStart()))) { // calculate duration between this period start and last period end.. final Duration freeDuration = new Duration(lastPeriodEnd, period.getStart()); if (new TemporalAmountComparator().compare(freeDuration.getDuration(), duration) >= 0) { fb.getPeriods().add(new Period(lastPeriodEnd, freeDuration.getDuration())); } } if (period.getEnd().after(lastPeriodEnd)) { lastPeriodEnd = period.getEnd(); } } return fb; } }
public FreeBusy build() { final FreeBusy fb = new FreeBusy(); fb.getParameters().add(FbType.FREE); final PeriodList periods = getConsumedTime(components, start, end); final DateRange range = new DateRange(start, end); // Add final consumed time to avoid special-case end-of-list processing periods.add(new Period(end, end)); DateTime lastPeriodEnd = new DateTime(start); // where no time is consumed set the last period end as the range start.. for (final Period period : periods) { // check if period outside bounds.. or period intersects with the end of the range.. if (range.contains(period) || (range.intersects(period) && period.getStart().after(range.getRangeStart()))) { // calculate duration between this period start and last period end.. final Duration freeDuration = new Duration(lastPeriodEnd, period.getStart()); if (new TemporalAmountComparator().compare(freeDuration.getDuration(), duration) >= 0) { fb.getPeriods().add(new Period(lastPeriodEnd, freeDuration.getDuration())); } } if (period.getEnd().after(lastPeriodEnd)) { lastPeriodEnd = period.getEnd(); } } return fb; } }
fb.getParameters().add(new FbType(AVAIL_ENUM.get(availability))); DateTime start = new DateTime(((DtStart) l.getProperty(Property.DTSTART)).getDate());