========================================================================
Database Info
TABLE NAME PRIMARY KEY COLUMNS
FOOD FOODID - AUTO NAME - TEXT SERVINGSIZE - TEXT FROMWHERE - TEXT NUTRITIONFACTS - INT(fk NUTRITIONS) HEALTHY - INT(0 OR 1)
MEAL MEALID - AUTO DATE - TEXT TIMEOFDAY - INT FOOD - INT(fk FOOD) LOCATION - TEXT FILLING - INT(0 or 1)
NUTRITIONS NUTRITIONSID - AUTO CALORIES - REAL TOTALFAT- REAL SATFAT- REAL TRANSFAT- REAL CHOLESTEROL- REAL SODIUM - REAL SUGAR - REAL PROTEIN - REAL
Food.java
package edu.ilstu.madapp;
public class Food
{
private long foodID;
private String name;
private String servingSize;
private String fromWhere;
private Nutrition nutrition;
private boolean isHealthy;
/**
*
*/
public Food()
{
super();
}
/**
* @param foodID
* @param name
* @param servingSize
* @param fromWhere
* @param nutrients
* @param isHealthy
*/
public Food(long foodID, String name, String servingSize, String fromWhere,
Nutrition nutrition, boolean isHealthy)
{
super();
this.foodID = foodID;
this.name = name;
this.servingSize = servingSize;
this.fromWhere = fromWhere;
this.nutrition = nutrition;
this.isHealthy = isHealthy;
}
/**
* @return the foodID
*/
public long getFoodID()
{
return foodID;
}
/**
* @param foodID the foodID to set
*/
public void setFoodID(long foodID)
{
this.foodID = foodID;
}
/**
* @return the name
*/
public String getName()
{
return name;
}
/**
* @param name the name to set
*/
public void setName(String name)
{
this.name = name;
}
/**
* @return the servingSize
*/
public String getServingSize()
{
return servingSize;
}
/**
* @param servingSize the servingSize to set
*/
public void setServingSize(String servingSize)
{
this.servingSize = servingSize;
}
/**
* @return the fromWhere
*/
public String getFromWhere()
{
return fromWhere;
}
/**
* @param fromWhere the fromWhere to set
*/
public void setFromWhere(String fromWhere)
{
this.fromWhere = fromWhere;
}
/**
* @return the nutrients
*/
public Nutrition getNutrients()
{
return nutrition;
}
/**
* @param nutrients the nutrients to set
*/
public void setNutrients(Nutrition nutrition)
{
this.nutrition = nutrition;
}
/**
* @return the isHealthy
*/
public boolean isHealthy()
{
return isHealthy;
}
/**
* @param isHealthy the isHealthy to set
*/
public void setHealthy(boolean isHealthy)
{
this.isHealthy = isHealthy;
}
}
Meal.java
package edu.ilstu.madapp;
import java.util.Date;
public class Meal
{
private long mealID;
private Date date;
private String TOD;
private Food[] food;
private String location;
private boolean isFilling;
/**
*
*/
public Meal()
{
super();
}
/**
* @param mealID
* @param date
* @param tOD
* @param food
* @param location
* @param isFilling
*/
public Meal(long mealID, Date date, String tOD, Food[] food,
String location, boolean isFilling)
{
super();
this.mealID = mealID;
this.date = date;
this.TOD = tOD;
this.food = food;
this.location = location;
this.isFilling = isFilling;
}
/**
* @return the mealID
*/
public long getMealID()
{
return mealID;
}
/**
* @param mealID the mealID to set
*/
public void setMealID(long mealID)
{
this.mealID = mealID;
}
/**
* @return the tOD
*/
public String getTOD()
{
return TOD;
}
/**
* @param tOD the tOD to set
*/
public void setTOD(String tOD)
{
TOD = tOD;
}
/**
* @return the date
*/
public Date getDate()
{
return date;
}
/**
* @param date the date to set
*/
public void setDate(Date date)
{
this.date = date;
}
/**
* @return the food
*/
public Food[] getFood()
{
return food;
}
/**
* @param food the food to set
*/
public void setFood(Food[] food)
{
this.food = food;
}
/**
* @return the location
*/
public String getLocation()
{
return location;
}
/**
* @param location the location to set
*/
public void setLocation(String location)
{
this.location = location;
}
/**
* @return the isFilling
*/
public boolean isFilling()
{
return isFilling;
}
/**
* @param isFilling the isFilling to set
*/
public void setFilling(boolean isFilling)
{
this.isFilling = isFilling;
}
}
Nutrition.java
package edu.ilstu.madapp;
public class Nutrition
{
private double calories;
private double totalFat;
private double satFat;
private double transFat;
private double cholesterol;
private double sodium;
private double sugar;
private double protein;
/**
*
*/
public Nutrition()
{
super();
}
/**
* @param calories
* @param totalFat
* @param satFat
* @param transFat
* @param cholesterol
* @param sodium
* @param sugar
* @param protein
*/
public Nutrition(double calories, double totalFat, double satFat,
double transFat, double cholesterol, double sodium, double sugar,
double protein)
{
super();
this.calories = calories;
this.totalFat = totalFat;
this.satFat = satFat;
this.transFat = transFat;
this.cholesterol = cholesterol;
this.sodium = sodium;
this.sugar = sugar;
this.protein = protein;
}
/**
* @return the calories
*/
public double getCalories()
{
return calories;
}
/**
* @param calories the calories to set
*/
public void setCalories(double calories)
{
this.calories = calories;
}
/**
* @return the totalFat
*/
public double getTotalFat()
{
return totalFat;
}
/**
* @param totalFat the totalFat to set
*/
public void setTotalFat(double totalFat)
{
this.totalFat = totalFat;
}
/**
* @return the satFat
*/
public double getSatFat()
{
return satFat;
}
/**
* @param satFat the satFat to set
*/
public void setSatFat(double satFat)
{
this.satFat = satFat;
}
/**
* @return the transFat
*/
public double getTransFat()
{
return transFat;
}
/**
* @param transFat the transFat to set
*/
public void setTransFat(double transFat)
{
this.transFat = transFat;
}
/**
* @return the cholesterol
*/
public double getCholesterol()
{
return cholesterol;
}
/**
* @param cholesterol the cholesterol to set
*/
public void setCholesterol(double cholesterol)
{
this.cholesterol = cholesterol;
}
/**
* @return the sodium
*/
public double getSodium()
{
return sodium;
}
/**
* @param sodium the sodium to set
*/
public void setSodium(double sodium)
{
this.sodium = sodium;
}
/**
* @return the sugar
*/
public double getSugar()
{
return sugar;
}
/**
* @param sugar the sugar to set
*/
public void setSugar(double sugar)
{
this.sugar = sugar;
}
/**
* @return the protein
*/
public double getProtein()
{
return protein;
}
/**
* @param protein the protein to set
*/
public void setProtein(double protein)
{
this.protein = protein;
}
}
No comments:
Post a Comment