Class Stomach

java.lang.Object
  extended by Stomach

public class Stomach
extends java.lang.Object

Represents a primitive stomach. The stomach can eat (intake) food. The stomach can also digest a random amount of the food eaten.


Constructor Summary
Stomach()
          Creates a primitive stomach
 
Method Summary
 void digest()
          Causes a random amount of food in the stomach to be digested.
 double getAmountDigested()
          Returns the total amount of food digested
 double getAmountFood()
          Returns current amount of food in the stomach
 void ingest(double amount)
          Causes the stomach to intake the specified amount of food.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stomach

public Stomach()
Creates a primitive stomach

Method Detail

digest

public void digest()
Causes a random amount of food in the stomach to be digested.


getAmountDigested

public double getAmountDigested()
Returns the total amount of food digested

Returns:
cummulative amount of food digested

getAmountFood

public double getAmountFood()
Returns current amount of food in the stomach

Returns:
current amount of food in stomach

ingest

public void ingest(double amount)
Causes the stomach to intake the specified amount of food. The specified amount is added to the total amount of food currently in the stomach.

Parameters:
amount - Amount of food to eat

toString

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