Class Carrot
- java.lang.Object
-
- Carrot
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
elapseDay()
Elapses a day in the life of the carrot.java.lang.String
getName()
All carrots are named Carrot by default, unless another name was set on construction.java.lang.String
getStatus()
Returns a String describing the current state of the carrot.int
getWaterLevel()
Gets the water level of the carrot.void
waterPlant(int unitsWater)
Waters the carrot
-
-
-
Method Detail
-
getName
public java.lang.String getName()
All carrots are named Carrot by default, unless another name was set on construction.
-
waterPlant
public void waterPlant(int unitsWater)
Waters the carrot- Specified by:
waterPlant
in interfacePlant
- Parameters:
unitsWater
- number of units of water that the carrot was given
-
elapseDay
public void elapseDay()
Elapses a day in the life of the carrot. This makes the carrot older and decreases the current level of water.
-
getStatus
public java.lang.String getStatus()
Returns a String describing the current state of the carrot.
-
getWaterLevel
public int getWaterLevel()
Gets the water level of the carrot.- Specified by:
getWaterLevel
in interfacePlant
- Returns:
- water level
-
-