Package com.ccprog3.ingredients
Enum Class Ingredient
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCoffee Beans 1008 gLarge Cup 40 pcsMedium Cup 64 pcsMilk 640 fl ozEmpty orSyrupIngredient
640 fl ozSmall Cup 80 pcsWater 640 fl oz -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gives the volume of any Cup in fl ozdouble
getMax()
Returns the max capacity aStorageBin
can hold of theIngredient
getUnit()
Gets the unit of measurement for theIngredient
toString()
static Ingredient
Returns the enum constant of this class with the specified name.static Ingredient[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SMALL_CUP
Small Cup 80 pcs -
MEDIUM_CUP
Medium Cup 64 pcs -
LARGE_CUP
Large Cup 40 pcs -
COFFEE_BEANS
Coffee Beans 1008 g -
MILK
Milk 640 fl oz -
WATER
Water 640 fl oz -
NONE
Empty orSyrupIngredient
640 fl oz
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
- Overrides:
toString
in classEnum<Ingredient>
-
getUnit
-
getMax
public double getMax()Returns the max capacity aStorageBin
can hold of theIngredient
- Returns:
- Max capacity
-
getCupVolume
Gives the volume of any Cup in fl oz- Returns:
- The volume in fl oz
- Throws:
IllegalArgumentException
-Ingredient
is not a Cup
-