Search in sources :

Example 1 with NumberList

use of net.fortuna.ical4j.model.NumberList in project ofbiz-framework by apache.

the class ICalRecurConverter method visit.

@SuppressWarnings("unchecked")
@Override
public void visit(TemporalExpressions.DayOfMonthRange expr) {
    int startDay = expr.getStartDay();
    int endDay = expr.getEndDay();
    NumberList dayList = new NumberList();
    dayList.add(startDay);
    while (startDay != endDay) {
        startDay++;
        dayList.add(startDay);
    }
    Recur recur = new Recur(Recur.DAILY, 0);
    recur.getMonthDayList().addAll(dayList);
    this.state.addRecur(recur);
}
Also used : NumberList(net.fortuna.ical4j.model.NumberList) Recur(net.fortuna.ical4j.model.Recur)

Example 2 with NumberList

use of net.fortuna.ical4j.model.NumberList in project ofbiz-framework by apache.

the class ICalRecurConverter method visit.

@SuppressWarnings("unchecked")
@Override
public void visit(MinuteRange expr) {
    NumberList minuteList = new NumberList();
    minuteList.addAll(expr.getMinuteRangeAsSet());
    Recur recur = new Recur(Recur.MINUTELY, 0);
    recur.getMinuteList().addAll(minuteList);
    this.state.addRecur(recur);
}
Also used : NumberList(net.fortuna.ical4j.model.NumberList) Recur(net.fortuna.ical4j.model.Recur)

Example 3 with NumberList

use of net.fortuna.ical4j.model.NumberList in project ofbiz-framework by apache.

the class ICalRecurConverter method visit.

@SuppressWarnings("unchecked")
@Override
public void visit(HourRange expr) {
    NumberList hourList = new NumberList();
    hourList.addAll(expr.getHourRangeAsSet());
    Recur recur = new Recur(Recur.HOURLY, 0);
    recur.getHourList().addAll(hourList);
    this.state.addRecur(recur);
}
Also used : NumberList(net.fortuna.ical4j.model.NumberList) Recur(net.fortuna.ical4j.model.Recur)

Example 4 with NumberList

use of net.fortuna.ical4j.model.NumberList in project ofbiz-framework by apache.

the class ICalRecurConverter method visit.

@SuppressWarnings("unchecked")
@Override
public void visit(TemporalExpressions.MonthRange expr) {
    int startMonth = expr.getStartMonth();
    int endMonth = expr.getEndMonth();
    Calendar cal = Calendar.getInstance();
    int maxMonth = cal.getActualMaximum(Calendar.MONTH);
    NumberList monthList = new NumberList();
    monthList.add(startMonth + 1);
    while (startMonth != endMonth) {
        startMonth++;
        if (startMonth > maxMonth) {
            startMonth = Calendar.JANUARY;
        }
        monthList.add(startMonth + 1);
    }
    Recur recur = new Recur(Recur.MONTHLY, 0);
    recur.getMonthList().addAll(monthList);
    this.state.addRecur(recur);
}
Also used : Calendar(com.ibm.icu.util.Calendar) NumberList(net.fortuna.ical4j.model.NumberList) Recur(net.fortuna.ical4j.model.Recur)

Aggregations

NumberList (net.fortuna.ical4j.model.NumberList)4 Recur (net.fortuna.ical4j.model.Recur)4 Calendar (com.ibm.icu.util.Calendar)1