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);
}
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);
}
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);
}
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);
}
Aggregations