1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
package ca.spaz.cron.database; |
5 |
|
|
6 |
|
|
7 |
|
public class Minerals extends NutrientTable { |
8 |
|
public double calcium; |
9 |
|
|
10 |
|
public double copper; |
11 |
|
|
12 |
|
public double iron; |
13 |
|
|
14 |
|
public double magnesium; |
15 |
|
|
16 |
|
public double manganese; |
17 |
|
|
18 |
|
public double phosphorus; |
19 |
|
|
20 |
|
public double potassium; |
21 |
|
|
22 |
|
public double selenium; |
23 |
|
|
24 |
|
public double sodium; |
25 |
|
|
26 |
|
public double zinc; |
27 |
|
|
28 |
0 |
public Minerals() { |
29 |
0 |
} |
30 |
|
|
31 |
|
public Minerals(Food f) { |
32 |
0 |
super(f); |
33 |
0 |
} |
34 |
|
|
35 |
|
public void addFood(Serving food) { |
36 |
0 |
double weight = food.getGrams() / 100.0; |
37 |
0 |
super.addFood(food.getFood().getMinerals(), weight); |
38 |
0 |
} |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
protected String doGetTableName() { |
46 |
0 |
return "minerals"; |
47 |
|
} |
48 |
|
|
49 |
|
} |