|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Food
This interface defines a Food object in CRON-O-Meter.
Method Summary | |
---|---|
AminoAcids |
getAminoAcids()
Retrieve the Amino Acids list for this Food. |
double |
getCalories()
Deprecated. This method should apply only to Servings. |
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 source)
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. |
Method Detail |
---|
FoodGroup getFoodGroup()
FoodGroup
instance associated with this food.void setFoodGroup(FoodGroup foodGroup)
Food
implementation must be associated with a writeable datasource. If the
FoodGroup
is not already in this Food
's datasource,
it will be added.
foodGroup
- A FoodGroup
instance.java.lang.String getDescription()
void setDescription(java.lang.String text)
Food
implementation must be associated with a writeable datasource.
text
- The new description.java.util.List getMeasures()
Measure
s for this Food.
Measure
s associated with this Food.void setMeasures(java.util.List measures)
Measure
s for this food. The Food
implementation must be associated with a writeable datasource.
measures
- A list of Measure
objects that will completely
replace the ones currently in existence for this Food
.double getCalories()
MacroNutrients getMacroNutrients()
Minerals getMinerals()
Vitamins getVitamins()
AminoAcids getAminoAcids()
Lipids getLipids()
double getNutrientAmount(NutrientInfo ni)
ni
- the NutrientInfo
to look up.
void setNutrientAmount(NutrientInfo ni, double val)
Food
implementation must be associated with a writeable datasource.
ni
- the Nutrient to modify.val
- the amount of the Nutrient per unit.int getNumTimesConsumed()
java.lang.String getSource()
void setSource(java.lang.String source)
Food
implementation must be associated with a writeable datasource.
source
- IFoodDatasource getDataSource()
java.lang.String getSourceUID()
void setModified()
void setSourceUID(java.lang.String uid)
uid
- The Food
whose sourceUID will be used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |