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;
34 private Month lastCheck;
35 private boolean refresh;
38 Element parent = root.getChild(
"month-constraint");
39 for(Element el : (List<Element>) parent.getChildren(
"month")) {
40 add(
Month.valueOf(el.getAttributeValue(
"name")));
45 Element el =
new Element(
"month-constraint");
48 Element e =
new Element(
"month");
49 e.setAttribute(
"name", m.toString());
55 addAll(EnumSet.allOf(
Month.class));
62 if(m !=
null && contains(m)) {
63 refresh = !m.equals(lastCheck);
77 Calendar c = Calendar.getInstance();
79 switch(c.get(Calendar.MONTH)) {
82 case Calendar.FEBRUARY:
96 case Calendar.SEPTEMBER:
98 case Calendar.OCTOBER:
100 case Calendar.NOVEMBER:
102 case Calendar.DECEMBER:
Month getMonth(Date date)
void readXML(Element root)
void writeXML(Element root)
boolean isValid(Date date)