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

Public Member Functions

void readXML (Element root)
 
void writeXML (Element root)
 
DayOfMonthConstraint setAll ()
 
boolean isValid (Date date)
 
boolean needsRefresh ()
 
Integer getDayOfMonth (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/DayOfMonthConstraint.java.

Member Function Documentation

◆ getDayOfMonth()

Integer org.turro.scheduler.constraints.DayOfMonthConstraint.getDayOfMonth ( Date  date)

Definition at line 76 of file constraints/DayOfMonthConstraint.java.

76  {
77  Calendar c = Calendar.getInstance();
78  c.setTime(date);
79  return c.get(Calendar.DAY_OF_MONTH);
80  }
Here is the caller graph for this function:

◆ isValid()

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

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

60  {
61  refresh = false;
62  Integer dm = getDayOfMonth(date);
63  if(dm != null && contains(dm)) {
64  refresh = !dm.equals(lastCheck);
65  lastCheck = dm;
66  return true;
67  }
68  lastCheck = dm;
69  return isEmpty();
70  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ needsRefresh()

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

Definition at line 72 of file constraints/DayOfMonthConstraint.java.

72  {
73  return refresh;
74  }
Here is the caller graph for this function:

◆ readXML()

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

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

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

◆ setAll()

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

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

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

◆ writeXML()

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

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

43  {
44  Element el = new Element("day-of-month-constraint");
45  root.addContent(el);
46  for(Integer i : this) {
47  Element e = new Element("day");
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: