/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactory factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().add(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactoryImpl factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactory factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactory factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactoryImpl factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * Resets the timezone associated with the property. If utc is true, any TZID parameters are removed and the Java * timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the * default timezone (i.e. represents a "floating" local time) * * @param utc the UTC value */ public final void setUtc(final boolean utc) { if (dates == null || !Value.DATE_TIME.equals(dates.getType())) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } dates.setUtc(utc); getParameters().remove(getParameter(Parameter.TZID)); }
/** * Resets the timezone associated with the property. If utc is true, any TZID parameters are removed and the Java * timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the * default timezone (i.e. represents a "floating" local time) * * @param utc the UTC value */ public final void setUtc(final boolean utc) { if (dates == null || !Value.DATE_TIME.equals(dates.getType())) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } dates.setUtc(utc); getParameters().remove(getParameter(Parameter.TZID)); }
/** * Resets the timezone associated with the property. If utc is true, any TZID parameters are removed and the Java * timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the * default timezone (i.e. represents a "floating" local time) * @param utc the UTC value */ public final void setUtc(final boolean utc) { if (dates == null || !Value.DATE_TIME.equals(dates.getType())) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } dates.setUtc(utc); getParameters().remove(getParameter(Parameter.TZID)); } }
/** * Resets the timezone associated with the property. If utc is true, any TZID parameters are removed and the Java * timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the * default timezone (i.e. represents a "floating" local time) * * @param utc the UTC value */ public final void setUtc(final boolean utc) { if (dates == null || !Value.DATE_TIME.equals(dates.getType())) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } dates.setUtc(utc); getParameters().remove(getParameter(Parameter.TZID)); }
@Override public DateList transform(DateList dates) { if (hourList.isEmpty()) { return dates; } final DateList hourlyDates = Dates.getDateListInstance(dates); for (final Date date : dates) { if (EnumSet.of(DAILY, WEEKLY, MONTHLY, YEARLY).contains(getFrequency())) { hourlyDates.addAll(new ExpansionFilter(hourlyDates.getType()).apply(date)); } else { Optional<Date> limit = new LimitFilter().apply(date); if (limit.isPresent()) { hourlyDates.add(limit.get()); } } } return hourlyDates; }
/** * Resets the timezone associated with the property. If utc is true, any TZID parameters are removed and the Java * timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the * default timezone (i.e. represents a "floating" local time) * * @param utc the UTC value */ public final void setUtc(final boolean utc) { if (dates == null || !Value.DATE_TIME.equals(dates.getType())) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } dates.setUtc(utc); getParameters().remove(getParameter(Parameter.TZID)); }
@Override public DateList transform(DateList dates) { if (minuteList.isEmpty()) { return dates; } final DateList minutelyDates = Dates.getDateListInstance(dates); for (final Date date : dates) { if (EnumSet.of(HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY).contains(getFrequency())) { minutelyDates.addAll(new ExpansionFilter(minutelyDates.getType()).apply(date)); } else { Optional<Date> limit = new LimitFilter().apply(date); if (limit.isPresent()) { minutelyDates.add(limit.get()); } } } return minutelyDates; }
/** * Instantiate a new datelist with the same type, timezone and utc settings * as the origList. * @param origList * @return a new empty list. */ private static DateList getDateListInstance(final DateList origList) { final DateList list = new DateList(origList.getType()); if (origList.isUtc()) { list.setUtc(true); } else { list.setTimeZone(origList.getTimeZone()); } return list; }
/** * Instantiate a new datelist with the same type, timezone and utc settings * as the origList. * * @param origList * @return a new empty list. */ private static DateList getDateListInstance(final DateList origList) { final DateList list = new DateList(origList.getType()); if (origList.isUtc()) { list.setUtc(true); } else { list.setTimeZone(origList.getTimeZone()); } return list; }
@Override public DateList transform(DateList dates) { if (yearDayList.isEmpty()) { return dates; } final DateList yearDayDates = Dates.getDateListInstance(dates); for (final Date date : dates) { if (getFrequency() == YEARLY) { yearDayDates.addAll(new ExpansionFilter(yearDayDates.getType()).apply(date)); } else { Optional<Date> limit = new LimitFilter().apply(date); if (limit.isPresent()) { yearDayDates.add(limit.get()); } } } return yearDayDates; }
@Override public DateList transform(DateList dates) { if (secondList.isEmpty()) { return dates; } final DateList secondlyDates = Dates.getDateListInstance(dates); for (final Date date : dates) { if (getFrequency() == Frequency.SECONDLY) { Optional<Date> limit = new LimitFilter().apply(date); if (limit.isPresent()) { secondlyDates.add(limit.get()); } } else { secondlyDates.addAll(new ExpansionFilter(secondlyDates.getType()).apply(date)); } } return secondlyDates; }
/** * Instantiate a new datelist with the same type, timezone and utc settings * as the origList. * * @param origList * @return a new empty list. */ public static DateList getDateListInstance(final DateList origList) { final DateList list = new DateList(origList.getType()); if (origList.isUtc()) { list.setUtc(true); } else { list.setTimeZone(origList.getTimeZone()); } return list; }
/** * Instantiate a new datelist with the same type, timezone and utc settings * as the origList. * * @param origList * @return a new empty list. */ public static DateList getDateListInstance(final DateList origList) { final DateList list = new DateList(origList.getType()); if (origList.isUtc()) { list.setUtc(true); } else { list.setTimeZone(origList.getTimeZone()); } return list; }
@Override public DateList transform(DateList dates) { if (monthList.isEmpty()) { return dates; } final DateList monthlyDates = Dates.getDateListInstance(dates); for (final Date date : dates) { if (getFrequency() == Frequency.YEARLY) { monthlyDates.addAll(new ExpansionFilter(monthlyDates.getType()).apply(date)); } else { Optional<Date> limit = new LimitFilter().apply(date); if (limit.isPresent()) { monthlyDates.add(limit.get()); } } } return monthlyDates; }
/** * Instantiate a new datelist with the same type, timezone and utc settings * as the origList. * * @param origList * @return a new empty list. */ private static DateList getDateListInstance(final DateList origList) { final DateList list = new DateList(origList.getType()); if (origList.isUtc()) { list.setUtc(true); } else { list.setTimeZone(origList.getTimeZone()); } return list; }