|
|
@ -119,15 +119,15 @@ public abstract class RepetitionList
|
|
|
|
public abstract Repetition getNewest();
|
|
|
|
public abstract Repetition getNewest();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the total number of repetitions for each month, from the first
|
|
|
|
* Returns the total number of successful repetitions for each month, from the first
|
|
|
|
* repetition until today, grouped by day of week.
|
|
|
|
* repetition until today, grouped by day of week.
|
|
|
|
* <p>
|
|
|
|
* <p>
|
|
|
|
* The repetitions are returned in a HashMap. The key is the timestamp for
|
|
|
|
* The repetitions are returned in a HashMap. The key is the timestamp for
|
|
|
|
* the first day of the month, at midnight (00:00). The value is an integer
|
|
|
|
* the first day of the month, at midnight (00:00). The value is an integer
|
|
|
|
* array with 7 entries. The first entry contains the total number of
|
|
|
|
* array with 7 entries. The first entry contains the total number of
|
|
|
|
* repetitions during the specified month that occurred on a Saturday. The
|
|
|
|
* successful repetitions during the specified month that occurred on a Saturday. The
|
|
|
|
* second entry corresponds to Sunday, and so on. If there are no
|
|
|
|
* second entry corresponds to Sunday, and so on. If there are no
|
|
|
|
* repetitions during a certain month, the value is null.
|
|
|
|
* successful repetitions during a certain month, the value is null.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return total number of repetitions by month versus day of week
|
|
|
|
* @return total number of repetitions by month versus day of week
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -140,6 +140,11 @@ public abstract class RepetitionList
|
|
|
|
|
|
|
|
|
|
|
|
for (Repetition r : reps)
|
|
|
|
for (Repetition r : reps)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if ((habit.getData().type == Habit.YES_NO_HABIT)
|
|
|
|
|
|
|
|
&& (r.getValue() == Checkmark.SKIPPED_EXPLICITLY)) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Calendar date = r.getTimestamp().toCalendar();
|
|
|
|
Calendar date = r.getTimestamp().toCalendar();
|
|
|
|
int weekday = r.getTimestamp().getWeekday();
|
|
|
|
int weekday = r.getTimestamp().getWeekday();
|
|
|
|
date.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
date.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
@ -191,7 +196,13 @@ public abstract class RepetitionList
|
|
|
|
throw new IllegalStateException("habit must NOT be numerical");
|
|
|
|
throw new IllegalStateException("habit must NOT be numerical");
|
|
|
|
|
|
|
|
|
|
|
|
Repetition rep = getByTimestamp(timestamp);
|
|
|
|
Repetition rep = getByTimestamp(timestamp);
|
|
|
|
if (rep != null) remove(rep);
|
|
|
|
if (rep != null) {
|
|
|
|
|
|
|
|
remove(rep);
|
|
|
|
|
|
|
|
if (rep.getValue() == Checkmark.CHECKED_EXPLICITLY) {
|
|
|
|
|
|
|
|
rep = new Repetition(timestamp, Checkmark.SKIPPED_EXPLICITLY);
|
|
|
|
|
|
|
|
add(rep);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rep = new Repetition(timestamp, Checkmark.CHECKED_EXPLICITLY);
|
|
|
|
rep = new Repetition(timestamp, Checkmark.CHECKED_EXPLICITLY);
|
|
|
@ -203,12 +214,12 @@ public abstract class RepetitionList
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the number of all repetitions
|
|
|
|
* Returns the number of all successful repetitions
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return number of all repetitions
|
|
|
|
* @return number of all successful repetitions
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@NonNull
|
|
|
|
@NonNull
|
|
|
|
public abstract long getTotalCount();
|
|
|
|
public abstract long getTotalSuccessfulCount();
|
|
|
|
|
|
|
|
|
|
|
|
public void toggle(Timestamp timestamp, int value)
|
|
|
|
public void toggle(Timestamp timestamp, int value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|