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

Public Member Functions

boolean isValid (Date date)
 
boolean needsRefresh ()
 
WeekDay getWeekDay (Date date)
 

Detailed Description

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

Definition at line 29 of file task/constraints/WeekDayConstraint.java.

Member Function Documentation

◆ getWeekDay()

WeekDay org.turro.scheduler.task.constraints.WeekDayConstraint.getWeekDay ( Date  date)

Definition at line 50 of file task/constraints/WeekDayConstraint.java.

50  {
51  Calendar c = Calendar.getInstance();
52  c.setTime(date);
53  return switch(c.get(Calendar.DAY_OF_WEEK)) {
54  case Calendar.MONDAY -> WeekDay.MONDAY;
55  case Calendar.TUESDAY -> WeekDay.TUESDAY;
56  case Calendar.WEDNESDAY -> WeekDay.WEDNESDAY;
57  case Calendar.THURSDAY -> WeekDay.THURSDAY;
58  case Calendar.FRIDAY -> WeekDay.FRIDAY;
59  case Calendar.SATURDAY -> WeekDay.SATURDAY;
60  case Calendar.SUNDAY -> WeekDay.SUNDAY;
61  default -> null;
62  };
63  }
Here is the caller graph for this function:

◆ isValid()

boolean org.turro.scheduler.task.constraints.WeekDayConstraint.isValid ( Date  date)

Definition at line 34 of file task/constraints/WeekDayConstraint.java.

34  {
35  refresh = false;
36  WeekDay wd = getWeekDay(date);
37  if(wd != null && contains(wd)) {
38  refresh = !wd.equals(lastCheck);
39  lastCheck = wd;
40  return true;
41  }
42  lastCheck = wd;
43  return isEmpty();
44  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ needsRefresh()

boolean org.turro.scheduler.task.constraints.WeekDayConstraint.needsRefresh ( )

Definition at line 46 of file task/constraints/WeekDayConstraint.java.

46  {
47  return refresh;
48  }
Here is the caller graph for this function:

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