/** * Returns a single occurrence of a recurring event. * @param date a date on which the occurence should occur * @return a single non-recurring event instance for the specified date, or null if the event doesn't * occur on the specified date * @throws IOException where an error occurs reading data * @throws URISyntaxException where an invalid URI is encountered * @throws ParseException where an error occurs parsing data */ public final VEvent getOccurrence(final Date date) throws IOException, URISyntaxException, ParseException { final PeriodList consumedTime = getConsumedTime(date, date); for (final Iterator i = consumedTime.iterator(); i.hasNext();) { final Period p = (Period) i.next(); if (p.getStart().equals(date)) { final VEvent occurrence = (VEvent) this.copy(); occurrence.getProperties().add(new RecurrenceId(date)); return occurrence; } } return null; }
/** * Returns a single occurrence of a recurring event. * @param date a date on which the occurence should occur * @return a single non-recurring event instance for the specified date, or null if the event doesn't * occur on the specified date * @throws IOException where an error occurs reading data * @throws URISyntaxException where an invalid URI is encountered * @throws ParseException where an error occurs parsing data */ public final VEvent getOccurrence(final Date date) throws IOException, URISyntaxException, ParseException { final PeriodList consumedTime = getConsumedTime(date, date); for (final Period p : consumedTime) { if (p.getStart().equals(date)) { final VEvent occurrence = (VEvent) this.copy(); occurrence.getProperties().add(new RecurrenceId(date)); return occurrence; } } return null; }
/** * Returns a single occurrence of a recurring event. * @param date a date on which the occurence should occur * @return a single non-recurring event instance for the specified date, or null if the event doesn't * occur on the specified date * @throws IOException where an error occurs reading data * @throws URISyntaxException where an invalid URI is encountered * @throws ParseException where an error occurs parsing data */ public final VEvent getOccurrence(final Date date) throws IOException, URISyntaxException, ParseException { final PeriodList consumedTime = getConsumedTime(date, date); for (final Period p : consumedTime) { if (p.getStart().equals(date)) { final VEvent occurrence = (VEvent) this.copy(); occurrence.getProperties().add(new RecurrenceId(date)); return occurrence; } } return null; }
/** * Returns a single occurrence of a recurring event. * @param date a date on which the occurence should occur * @return a single non-recurring event instance for the specified date, or null if the event doesn't * occur on the specified date * @throws IOException where an error occurs reading data * @throws URISyntaxException where an invalid URI is encountered * @throws ParseException where an error occurs parsing data */ public final VEvent getOccurrence(final Date date) throws IOException, URISyntaxException, ParseException { final PeriodList consumedTime = getConsumedTime(date, date); for (final Period p : consumedTime) { if (p.getStart().equals(date)) { final VEvent occurrence = (VEvent) this.copy(); occurrence.getProperties().add(new RecurrenceId(date)); return occurrence; } } return null; }
/** * Returns a single occurrence of a recurring event. * @param date a date on which the occurence should occur * @return a single non-recurring event instance for the specified date, or null if the event doesn't * occur on the specified date * @throws IOException where an error occurs reading data * @throws URISyntaxException where an invalid URI is encountered * @throws ParseException where an error occurs parsing data */ public final VEvent getOccurrence(final Date date) throws IOException, URISyntaxException, ParseException { final PeriodList consumedTime = getConsumedTime(date, date); for (final Period p : consumedTime) { if (p.getStart().equals(date)) { final VEvent occurrence = (VEvent) this.copy(); occurrence.getProperties().add(new RecurrenceId(date)); return occurrence; } } return null; }
VEvent eventBis = (VEvent)event.copy(); assertEquals(eventBis, event);
suite.addTest(new VEventTest("testValidation", event)); event = (VEvent) event.copy(); event = (VEvent) event.copy(); start = (DtStart) event.getProperty(Property.DTSTART); start.getParameters().replace(Value.DATE); event = (VEvent) event.copy(); start = (DtStart) event.getProperty(Property.DTSTART); start.getParameters().replace(Value.DATE_TIME);