ca.spaz.cron.database
Class Serving

java.lang.Object
  extended by ca.spaz.cron.database.Serving

public class Serving
extends java.lang.Object

Stores an amount and time of a food serving

Author:
davidson

Constructor Summary
Serving()
           
Serving(Food f)
           
Serving(Food f, double grams)
           
 
Method Summary
 void deleteFromDatabase()
           
 boolean exists()
           
 double getAmount()
           
 java.util.Date getDate()
           
 Food getFood()
           
 double getGrams()
           
 int getID()
           
 int getMeal()
           
 Measure getMeasure()
           
 void setAmount(double val)
           
 void setDate(java.util.Date d)
           
 void setFood(Food food)
           
 void setGrams(double amount)
           
 void setID(int id)
           
 void setMeal(int meal)
           
 void setMeasure(int MID)
           
 void setMeasure(Measure measure)
           
 void updateDatabase()
          Update the existing food information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Serving

public Serving()

Serving

public Serving(Food f)

Serving

public Serving(Food f,
               double grams)
Method Detail

getGrams

public double getGrams()

getAmount

public double getAmount()

setAmount

public void setAmount(double val)

getFood

public Food getFood()

getDate

public java.util.Date getDate()

setDate

public void setDate(java.util.Date d)

exists

public boolean exists()
Returns:
true if the object is already in the database

updateDatabase

public void updateDatabase()
Update the existing food information


deleteFromDatabase

public void deleteFromDatabase()

setGrams

public void setGrams(double amount)

getMeal

public int getMeal()
Returns:
the ID of the meal this serving was eaten at.

getID

public int getID()
Returns:
Returns the iD.

setID

public void setID(int id)
Parameters:
id - The ID to set.

getMeasure

public Measure getMeasure()
Returns:
Returns the measure.

setMeasure

public void setMeasure(Measure measure)
Parameters:
measure - The measure to set.

setMeal

public void setMeal(int meal)
Parameters:
meal - The meal to set.

setFood

public void setFood(Food food)
Parameters:
food -

setMeasure

public void setMeasure(int MID)


Copyright © 2005 Spaz. All Rights Reserved.