18 package org.turro.scheduler.constraints;
20 import java.util.Calendar;
21 import java.util.Date;
22 import java.util.HashSet;
23 import java.util.List;
24 import org.jdom.Element;
33 private Integer lastCheck;
34 private boolean refresh;
37 Element parent = root.getChild(
"hour-constraint");
38 for(Element el : (List<Element>) parent.getChildren(
"hour")) {
39 add(Integer.valueOf(el.getAttributeValue(
"name")));
44 Element el =
new Element(
"hour-constraint");
46 for(Integer i :
this) {
47 Element e =
new Element(
"hour");
48 e.setAttribute(
"name", i +
"");
54 for(
int i = 0; i < 24; i++) {
61 for(
int i = 0; i < 12; i++) {
68 for(
int i = 12; i < 24; i++) {
77 if(h !=
null && contains(h)) {
78 refresh = !h.equals(lastCheck);
91 Calendar c = Calendar.getInstance();
93 return c.get(Calendar.HOUR_OF_DAY);
void readXML(Element root)
HourConstraint setAllPM()
void writeXML(Element root)
boolean isValid(Date date)
HourConstraint setAllAM()
Integer getHour(Date date)