1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
package ca.spaz.cron.targets; |
5 |
|
|
6 |
|
import ca.spaz.cron.database.NutrientInfo; |
7 |
|
import ca.spaz.cron.user.User; |
8 |
|
|
9 |
0 |
public class CustomTargetModel { |
10 |
|
|
11 |
|
private static final String TARGET_MIN = "TARGET_MIN"; |
12 |
|
private static final String TARGET_MAX = "TARGET_MAX"; |
13 |
|
|
14 |
|
public double getTargetMinimum(User user, NutrientInfo ni) { |
15 |
0 |
return Double.parseDouble( |
16 |
|
user.getUserPreference(TARGET_MIN + "_" + ni.getName())); |
17 |
|
} |
18 |
|
|
19 |
|
public double getTargetMaximum(User user, NutrientInfo ni) { |
20 |
0 |
return Double.parseDouble( |
21 |
|
user.getUserPreference(TARGET_MAX + "_" + ni.getName())); |
22 |
|
} |
23 |
|
|
24 |
|
public String toString() { |
25 |
0 |
return "Custom"; |
26 |
|
} |
27 |
|
|
28 |
|
} |