forked from mrigor87/CalorieManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserMealsUtil.java
More file actions
35 lines (31 loc) · 1.37 KB
/
UserMealsUtil.java
File metadata and controls
35 lines (31 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package ru.javawebinar.topjava.util;
import ru.javawebinar.topjava.model.UserMeal;
import ru.javawebinar.topjava.model.UserMealWithExceed;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.Month;
import java.util.Arrays;
import java.util.List;
/**
* GKislin
* 31.05.2015.
*/
public class UserMealsUtil {
public static void main(String[] args) {
List<UserMeal> mealList = Arrays.asList(
new UserMeal(LocalDateTime.of(2015, Month.MAY, 30,10,0), "Завтрак", 500),
new UserMeal(LocalDateTime.of(2015, Month.MAY, 30,13,0), "Обед", 1000),
new UserMeal(LocalDateTime.of(2015, Month.MAY, 30,20,0), "Ужин", 500),
new UserMeal(LocalDateTime.of(2015, Month.MAY, 31,10,0), "Завтрак", 1000),
new UserMeal(LocalDateTime.of(2015, Month.MAY, 31,13,0), "Обед", 500),
new UserMeal(LocalDateTime.of(2015, Month.MAY, 31,20,0), "Ужин", 510)
);
getFilteredWithExceeded(mealList, LocalTime.of(7, 0), LocalTime.of(12,0), 2000);
// .toLocalDate();
// .toLocalTime();
}
public static List<UserMealWithExceed> getFilteredWithExceeded(List<UserMeal> mealList, LocalTime startTime, LocalTime endTime, int caloriesPerDay) {
// TODO return filtered list with correctly exceeded field
return null;
}
}