|
|
|
@ -186,20 +186,13 @@ public class OrderProcessor { |
|
|
|
* @return The MenuItem read in |
|
|
|
*/ |
|
|
|
private MenuItem readItem(Scanner sc) { |
|
|
|
if (sc.hasNext()) { |
|
|
|
String itemName = sc.next(); |
|
|
|
String itemName = sc.next(); |
|
|
|
|
|
|
|
if (sc.hasNextDouble()) { |
|
|
|
double itemCost = sc.nextDouble(); |
|
|
|
double itemCost = sc.nextDouble(); |
|
|
|
|
|
|
|
if (sc.hasNext()) { |
|
|
|
MenuItemType itemType = MenuItemType.valueOf(sc.next()); |
|
|
|
MenuItemType itemType = MenuItemType.valueOf(sc.next()); |
|
|
|
|
|
|
|
return new MenuItem(itemName, itemCost, itemType); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return new MenuItem(itemName, itemCost, itemType); |
|
|
|
} |
|
|
|
|
|
|
|
} |