Package com.ccprog3
Class CLISingleton
java.lang.Object
com.ccprog3.CLISingleton
-
Method Summary
Modifier and TypeMethodDescriptionDisplay for creating a newCoffeeTruck
double
Display to ask user for the quantity ofIngredient
to add to aStorageBin
buyCoffee
(boolean special) Asks the user forCoffee
to buyint
chooseCoffeeTruck
(List<CoffeeTruck> coffeeTrucks) Display for choosing the available Coffee Trucks from the userint
chooseStorageBin
(List<StorageBin> storageBins) Display for choosing the available Storage Bins from theCoffeeTruck
void
close()
void
coffeeTruckInfo
(CoffeeTruck coffeeTruck, UserSingleton user) Displays info of aCoffeeTruck
void
dashboard
(List<CoffeeTruck> coffeeTrucks) Shows the dashboard summary of the Coffee Trucksvoid
Displays error messagestatic CLISingleton
Gets theCLISingleton
instancelogin()
Logs the user invoid
makeCoffee
(Map.Entry<Coffee, Money> sale) Shows the process of making aCoffee
boolean
Radio display functionDisplay to ask the user for a new locationAsks the user for new prices to setsetStorageBin
(boolean special) Display to ask the user for a newStorageBin
to replace the selected one
-
Method Details
-
getInstance
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
displayErr
Description copied from interface:UI
Displays error message- Specified by:
displayErr
in interfaceUI
- Parameters:
e
- Exception
-
login
-
addCoffeeTruck
Description copied from interface:UI
Display for creating a newCoffeeTruck
- Specified by:
addCoffeeTruck
in interfaceUI
- Returns:
- The
CoffeeTruck
generated
-
buyCoffee
-
makeCoffee
-
coffeeTruckInfo
Description copied from interface:UI
Displays info of aCoffeeTruck
- Specified by:
coffeeTruckInfo
in interfaceUI
- Parameters:
coffeeTruck
-CoffeeTruck
to displayuser
- User to show prices
-
chooseCoffeeTruck
Description copied from interface:UI
Display for choosing the available Coffee Trucks from the user- Specified by:
chooseCoffeeTruck
in interfaceUI
- Parameters:
coffeeTrucks
- List of Coffee Trucks of the user- Returns:
- Index of the chosen
CoffeeTruck
-
chooseStorageBin
Description copied from interface:UI
Display for choosing the available Storage Bins from theCoffeeTruck
- Specified by:
chooseStorageBin
in interfaceUI
- Parameters:
storageBins
- List of Storage Bins of theCoffeeTruck
- Returns:
- Index of the chosen
StorageBin
-
addStorageBinQuantity
public double addStorageBinQuantity()Description copied from interface:UI
Display to ask user for the quantity ofIngredient
to add to aStorageBin
- Specified by:
addStorageBinQuantity
in interfaceUI
- Returns:
- Quantity to add
-
setStorageBin
Description copied from interface:UI
Display to ask the user for a newStorageBin
to replace the selected one- Specified by:
setStorageBin
in interfaceUI
- Parameters:
special
-SpecialStorageBin
or regular- Returns:
- The new
StorageBin
to be replace with
-
setCoffeeTruckLocation
Description copied from interface:UI
Display to ask the user for a new location- Specified by:
setCoffeeTruckLocation
in interfaceUI
- Returns:
- New location
-
dashboard
Description copied from interface:UI
Shows the dashboard summary of the Coffee Trucks -
setPrices
-