|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBirdFeeder
This class models a simple bird feeder.
Constructor Summary | |
BirdFeeder(int initialLevel)
Construct a new bird feeder with the given amount of food. |
Method Summary | |
int |
feedTheBirds(int serving)
Feed each bird the serving size each until the food is all gone. |
int |
getFoodLevel()
Return the amount of food in the feeder. |
void |
setFoodLevel(int amount)
Fill the feeder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BirdFeeder(int initialLevel)
initialLevel
- the amount of food in the feeder in millilitersMethod Detail |
public int feedTheBirds(int serving)
serving
- the amount of food per serving in milliliters
public int getFoodLevel()
public void setFoodLevel(int amount)
amount
- the new amount of food in the feeder in milliliters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |