ca.spaz.cron.database
Class Measure

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

public class Measure
extends java.lang.Object

A measure maps a common measure for a food item (ie: a Cup, Teaspoon, Serving, etc...) The Measure contains the description of the measure and the number of grams of the food there are in the given measure.

Author:
davidson

Field Summary
static Measure GRAM
           
 
Constructor Summary
Measure()
           
Measure(double amount, java.lang.String description, double grams)
          Contruct a measure manually
 
Method Summary
 double getAmount()
          Get the standard amount of this measure.
 java.lang.String getDescription()
          Get the english name of the measure type
 int getFoodID()
           
 double getGrams()
          Get the number of grams in this measure
 int getID()
           
 void setAmount(double amount)
          Set the standard amount of this measure
 void setDescription(java.lang.String description)
          Set the english name of this measure type
 void setFoodID(int fid)
           
 void setGrams(double grams)
          Set the number of grams in this measure
 void setID(int id)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GRAM

public static final Measure GRAM
Constructor Detail

Measure

public Measure()

Measure

public Measure(double amount,
               java.lang.String description,
               double grams)
Contruct a measure manually

Parameters:
amount - the multiplier of the measure (ex: 0.5)
description - the measure name (ex: Cups)
grams - the number of grams in the multiple of this type (ex: grams in 1/2 a Cup)
Method Detail

getAmount

public double getAmount()
Get the standard amount of this measure. Example: 1.0 Servings, 0.5 Cups, 2.0 Tablespoons

Returns:
the multiplier for this measure

setAmount

public void setAmount(double amount)
Set the standard amount of this measure

Parameters:
amount - a multiplier

getDescription

public java.lang.String getDescription()
Get the english name of the measure type

Returns:
the english name of the measure type

setDescription

public void setDescription(java.lang.String description)
Set the english name of this measure type


getGrams

public double getGrams()
Get the number of grams in this measure

Returns:
the number of grams in the measure

setGrams

public void setGrams(double grams)
Set the number of grams in this measure


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getID

public int getID()

setID

public void setID(int id)

getFoodID

public int getFoodID()

setFoodID

public void setFoodID(int fid)


Copyright © 2005 Spaz. All Rights Reserved.