|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.spaz.cron.datasource.www.NutritionDataFood
public class NutritionDataFood
A Food implementation for NutritionDataDatasource
| Constructor Summary | |
|---|---|
NutritionDataFood(NutritionDataDatasource source,
com.meterware.httpunit.WebResponse response)
|
|
| Method Summary | |
|---|---|
AminoAcids |
getAminoAcids()
Retrieve the Amino Acids list for this Food. |
double |
getCalories()
A convenience method to retrieve the number of calories this Food provides. |
IFoodDatasource |
getDataSource()
|
java.lang.String |
getDescription()
Get a textual description of the food. |
FoodGroup |
getFoodGroup()
Get the FoodGroup associated with this food |
Lipids |
getLipids()
Retrieve the Lipids list for this Food. |
MacroNutrients |
getMacroNutrients()
Retrieve the MacroNutrients list for this Food. |
java.util.List |
getMeasures()
Retrieve a List of Measures for this Food. |
Minerals |
getMinerals()
Retrieve the Minerals list for this Food. |
int |
getNumTimesConsumed()
Get the number of times this food was consumed. |
double |
getNutrientAmount(NutrientInfo ni)
Get the amount of a nutrient provided by this Food. |
java.lang.String |
getSource()
Get the identifying 'source' of this food. |
java.lang.String |
getSourceUID()
Retrieve a key for this food uniquely identifying both its datasource and its own unique ID in the DS. |
Vitamins |
getVitamins()
Retrieve the Vitamins list for this Food. |
void |
setDescription(java.lang.String text)
Update this Food's description. |
void |
setFoodGroup(FoodGroup foodGroup)
Set the FoodGroup associated with this food. |
void |
setMeasures(java.util.List measures)
Replace the list of Measures for this food. |
void |
setModified()
Call this method to set the food as modified. |
void |
setNutrientAmount(NutrientInfo ni,
double val)
Set the amount of a nutrient provided by this Food. |
void |
setSource(java.lang.String string)
Set the identifying 'source' of this Food. |
void |
setSourceUID(java.lang.String uid)
Directly set the sourceUID of a food to that of another one. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NutritionDataFood(NutritionDataDatasource source,
com.meterware.httpunit.WebResponse response)
| Method Detail |
|---|
public FoodGroup getFoodGroup()
Food
getFoodGroup in interface FoodFoodGroup instance associated with this food.public java.lang.String getSource()
Food
getSource in interface Foodpublic java.util.List getMeasures()
FoodMeasures for this Food.
getMeasures in interface FoodMeasures associated with this Food.public void setMeasures(java.util.List measures)
FoodMeasures for this food. The Food
implementation must be associated with a writeable datasource.
setMeasures in interface Foodmeasures - A list of Measure objects that will completely
replace the ones currently in existence for this Food.public double getCalories()
Food
getCalories in interface Foodpublic MacroNutrients getMacroNutrients()
Food
getMacroNutrients in interface Foodpublic java.lang.String getDescription()
Food
getDescription in interface Foodpublic Minerals getMinerals()
Food
getMinerals in interface Foodpublic Vitamins getVitamins()
Food
getVitamins in interface Foodpublic AminoAcids getAminoAcids()
Food
getAminoAcids in interface Foodpublic Lipids getLipids()
Food
getLipids in interface Foodpublic double getNutrientAmount(NutrientInfo ni)
Food
getNutrientAmount in interface Foodni - the NutrientInfo to look up.
public void setNutrientAmount(NutrientInfo ni,
double val)
FoodFood
implementation must be associated with a writeable datasource.
setNutrientAmount in interface Foodni - the Nutrient to modify.val - the amount of the Nutrient per unit.public void setDescription(java.lang.String text)
FoodFood
implementation must be associated with a writeable datasource.
setDescription in interface Foodtext - The new description.public void setFoodGroup(FoodGroup foodGroup)
FoodFood
implementation must be associated with a writeable datasource. If the
FoodGroup is not already in this Food's datasource,
it will be added.
setFoodGroup in interface FoodfoodGroup - A FoodGroup instance.public int getNumTimesConsumed()
Food
getNumTimesConsumed in interface Foodpublic void setSource(java.lang.String string)
FoodFood
implementation must be associated with a writeable datasource.
setSource in interface Foodpublic IFoodDatasource getDataSource()
getDataSource in interface Foodpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getSourceUID()
Food
getSourceUID in interface Foodpublic void setModified()
Food
setModified in interface Foodpublic void setSourceUID(java.lang.String uid)
Food
setSourceUID in interface Fooduid - The Food whose sourceUID will be used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||