BrightSide Workbench Full Report + Source Code
org.turro.scheduler.constraints.MinuteConstraint Class Reference
Inheritance diagram for org.turro.scheduler.constraints.MinuteConstraint:
Collaboration diagram for org.turro.scheduler.constraints.MinuteConstraint:

Public Member Functions

void readXML (Element root)
 
void writeXML (Element root)
 
MinuteConstraint setAll ()
 
MinuteConstraint setEvery (int every)
 
boolean isValid (Date date)
 
boolean needsRefresh ()
 
Integer getMinute (Date date)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 31 of file constraints/MinuteConstraint.java.

Member Function Documentation

◆ getMinute()

Integer org.turro.scheduler.constraints.MinuteConstraint.getMinute ( Date  date)

Definition at line 83 of file constraints/MinuteConstraint.java.

83  {
84  Calendar c = Calendar.getInstance();
85  c.setTime(date);
86  return c.get(Calendar.MINUTE);
87  }
Here is the caller graph for this function:

◆ isValid()

boolean org.turro.scheduler.constraints.MinuteConstraint.isValid ( Date  date)

Definition at line 67 of file constraints/MinuteConstraint.java.

67  {
68  refresh = false;
69  Integer m = getMinute(date);
70  if(m != null && contains(m)) {
71  refresh = !m.equals(lastCheck);
72  lastCheck = m;
73  return true;
74  }
75  lastCheck = m;
76  return isEmpty();
77  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ needsRefresh()

boolean org.turro.scheduler.constraints.MinuteConstraint.needsRefresh ( )

Definition at line 79 of file constraints/MinuteConstraint.java.

79  {
80  return refresh;
81  }
Here is the caller graph for this function:

◆ readXML()

void org.turro.scheduler.constraints.MinuteConstraint.readXML ( Element  root)

Definition at line 36 of file constraints/MinuteConstraint.java.

36  {
37  Element parent = root.getChild("minute-constraint");
38  for(Element el : (List<Element>) parent.getChildren("minute")) {
39  add(Integer.valueOf(el.getAttributeValue("name")));
40  }
41  }
Here is the caller graph for this function:

◆ setAll()

MinuteConstraint org.turro.scheduler.constraints.MinuteConstraint.setAll ( )

Definition at line 53 of file constraints/MinuteConstraint.java.

53  {
54  for(int i = 0; i < 59; i++) {
55  add(i);
56  }
57  return this;
58  }

◆ setEvery()

MinuteConstraint org.turro.scheduler.constraints.MinuteConstraint.setEvery ( int  every)

Definition at line 60 of file constraints/MinuteConstraint.java.

60  {
61  for(int i = 0; i < 59; i += every) {
62  add(i);
63  }
64  return this;
65  }

◆ writeXML()

void org.turro.scheduler.constraints.MinuteConstraint.writeXML ( Element  root)

Definition at line 43 of file constraints/MinuteConstraint.java.

43  {
44  Element el = new Element("minute-constraint");
45  root.addContent(el);
46  for(Integer i : this) {
47  Element e = new Element("minute");
48  e.setAttribute("name", i + "");
49  el.addContent(e);
50  }
51  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: