18 package org.turro.scheduler.constraints;
20 import java.util.Calendar;
21 import java.util.Date;
22 import java.util.EnumSet;
23 import java.util.HashSet;
24 import java.util.List;
25 import org.jdom.Element;
35 private boolean refresh;
38 Element parent = root.getChild(
"week-day-constraint");
39 for(Element el : (List<Element>) parent.getChildren(
"week-day")) {
40 add(
WeekDay.valueOf(el.getAttributeValue(
"name")));
45 Element el =
new Element(
"week-day-constraint");
48 Element e =
new Element(
"week-day");
49 e.setAttribute(
"name", wd.toString());
55 addAll(EnumSet.allOf(
WeekDay.class));
62 if(wd !=
null && contains(wd)) {
63 refresh = !wd.equals(lastCheck);
76 Calendar c = Calendar.getInstance();
78 switch(c.get(Calendar.DAY_OF_WEEK)) {
81 case Calendar.TUESDAY:
83 case Calendar.WEDNESDAY:
85 case Calendar.THURSDAY:
89 case Calendar.SATURDAY:
boolean isValid(Date date)
void readXML(Element root)
void writeXML(Element root)
WeekDayConstraint setAll()
WeekDay getWeekDay(Date date)