java.lang.ObjectStomach
public class Stomach
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 |
---|
public Stomach()
Method Detail |
---|
public void digest()
public double getAmountDigested()
public double getAmountFood()
public void ingest(double amount)
amount
- Amount of food to eatpublic java.lang.String toString()
toString
in class java.lang.Object