View Javadoc

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      public MacroNutrients() {
37      }
38  
39      public MacroNutrients(Food f) {
40          super(f);
41      }
42  
43      public void addFood(Serving food) {
44          double weight = food.getGrams() / 100.0;
45          MacroNutrients mn = food.getFood().getMacroNutrients();
46          super.addFood(mn, weight);
47      }
48  
49      /*
50       * (non-Javadoc)
51       * 
52       * @see ca.spaz.cron.database.NutrientTable#doGetTableName()
53       */
54      protected String doGetTableName() {
55          return "macronutrients";
56      }
57  
58  }