Package com.ccprog3.coffeeTruck
Class StorageBin
java.lang.Object
com.ccprog3.coffeeTruck.StorageBin
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SpecialStorageBin
Storage Bin class to store Ingredients
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addQuantity
(double quantity) Adds to the quantity of theStorageBin
.Gets theIngredient
storeddouble
Gets the quantitytoString()
-
Constructor Details
-
StorageBin
StorageBin
constructor- Parameters:
ingredient
-Ingredient
type storedquantity
- Amount of theIngredient
- Throws:
ArithmeticException
- Quantity is negative or over the max capacity
-
-
Method Details
-
toString
-
getIngredient
-
getQuantity
public double getQuantity()Gets the quantity- Returns:
- The quantity
-
addQuantity
Adds to the quantity of theStorageBin
. Negative numbers can be used to subtract.- Parameters:
quantity
- The quantity to add- Throws:
ArithmeticException
- Quantity is negative or over the max capacity
-