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(
"minute-constraint");
38 for(Element el : (List<Element>) parent.getChildren(
"minute")) {
39 add(Integer.valueOf(el.getAttributeValue(
"name")));
44 Element el =
new Element(
"minute-constraint");
46 for(Integer i :
this) {
47 Element e =
new Element(
"minute");
48 e.setAttribute(
"name", i +
"");
54 for(
int i = 0; i < 59; i++) {
61 for(
int i = 0; i < 59; i += every) {
70 if(m !=
null && contains(m)) {
71 refresh = !m.equals(lastCheck);
84 Calendar c = Calendar.getInstance();
86 return c.get(Calendar.MINUTE);
boolean isValid(Date date)
void writeXML(Element root)
Integer getMinute(Date date)
MinuteConstraint setAll()
void readXML(Element root)
MinuteConstraint setEvery(int every)