|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.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 Measure s 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 Measure s 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 Food
FoodGroup
instance associated with this food.public java.lang.String getSource()
Food
getSource
in interface Food
public java.util.List getMeasures()
Food
Measure
s for this Food.
getMeasures
in interface Food
Measure
s associated with this Food.public void setMeasures(java.util.List measures)
Food
Measure
s for this food. The Food
implementation must be associated with a writeable datasource.
setMeasures
in interface Food
measures
- A list of Measure
objects that will completely
replace the ones currently in existence for this Food
.public double getCalories()
Food
getCalories
in interface Food
public MacroNutrients getMacroNutrients()
Food
getMacroNutrients
in interface Food
public java.lang.String getDescription()
Food
getDescription
in interface Food
public Minerals getMinerals()
Food
getMinerals
in interface Food
public Vitamins getVitamins()
Food
getVitamins
in interface Food
public AminoAcids getAminoAcids()
Food
getAminoAcids
in interface Food
public Lipids getLipids()
Food
getLipids
in interface Food
public double getNutrientAmount(NutrientInfo ni)
Food
getNutrientAmount
in interface Food
ni
- the NutrientInfo
to look up.
public void setNutrientAmount(NutrientInfo ni, double val)
Food
Food
implementation must be associated with a writeable datasource.
setNutrientAmount
in interface Food
ni
- the Nutrient to modify.val
- the amount of the Nutrient per unit.public void setDescription(java.lang.String text)
Food
Food
implementation must be associated with a writeable datasource.
setDescription
in interface Food
text
- The new description.public void setFoodGroup(FoodGroup foodGroup)
Food
Food
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 Food
foodGroup
- A FoodGroup
instance.public int getNumTimesConsumed()
Food
getNumTimesConsumed
in interface Food
public void setSource(java.lang.String string)
Food
Food
implementation must be associated with a writeable datasource.
setSource
in interface Food
public IFoodDatasource getDataSource()
getDataSource
in interface Food
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSourceUID()
Food
getSourceUID
in interface Food
public void setModified()
Food
setModified
in interface Food
public void setSourceUID(java.lang.String uid)
Food
setSourceUID
in interface Food
uid
- The Food
whose sourceUID will be used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |