| %line | %branch | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ca.spaz.cron.database.MacroNutrients |
|
|
| 1 | /* |
|
| 2 | * Created on Apr 2, 2005 by davidson |
|
| 3 | */ |
|
| 4 | package ca.spaz.cron.database; |
|
| 5 | ||
| 6 | ||
| 7 | /** |
|
| 8 | * @todo: Some of these aren't really 'macro nutrients' Either need to make |
|
| 9 | * 'Other' or 'General' class or figure something else out. |
|
| 10 | * |
|
| 11 | * @author davidson |
|
| 12 | */ |
|
| 13 | public class MacroNutrients extends NutrientTable { |
|
| 14 | ||
| 15 | // nutritional information: |
|
| 16 | public double kcals; |
|
| 17 | ||
| 18 | public double kj; |
|
| 19 | ||
| 20 | public double water; |
|
| 21 | ||
| 22 | public double protein; |
|
| 23 | ||
| 24 | public double lipid; |
|
| 25 | ||
| 26 | public double ash; |
|
| 27 | ||
| 28 | public double carbs; |
|
| 29 | ||
| 30 | public double fiber; |
|
| 31 | ||
| 32 | public double sugar; |
|
| 33 | ||
| 34 | public double starch; |
|
| 35 | ||
| 36 | 0 | public MacroNutrients() { |
| 37 | 0 | } |
| 38 | ||
| 39 | public MacroNutrients(Food f) { |
|
| 40 | 0 | super(f); |
| 41 | 0 | } |
| 42 | ||
| 43 | public void addFood(Serving food) { |
|
| 44 | 0 | double weight = food.getGrams() / 100.0; |
| 45 | 0 | MacroNutrients mn = food.getFood().getMacroNutrients(); |
| 46 | 0 | super.addFood(mn, weight); |
| 47 | 0 | } |
| 48 | ||
| 49 | /* |
|
| 50 | * (non-Javadoc) |
|
| 51 | * |
|
| 52 | * @see ca.spaz.cron.database.NutrientTable#doGetTableName() |
|
| 53 | */ |
|
| 54 | protected String doGetTableName() { |
|
| 55 | 0 | return "macronutrients"; |
| 56 | } |
|
| 57 | ||
| 58 | } |
| This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |