Skip to content

Commit

Permalink
mvp menu with periods and style fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuthu17 committed Mar 10, 2020
1 parent 02f24f2 commit 1263e64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/main/java/Dish.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
public class Dish {

/**
* Arraylist of all ingredients for dish
* Arraylist of all ingredients for dish.
*/
private ArrayList<String> ingredients;

/**
* Name of dish
* Name of dish.
*/
private String name;

/**
* Dish constructor
* Dish constructor.
* @param name name of dish
* @param ingredients arraylist of ingredients in dish
*/
Expand All @@ -23,7 +23,7 @@ public Dish(String name, ArrayList<String> ingredients) {
}

/**
* Returns ingredients in dish
* Returns ingredients in dish.
* @return arraylist of ingredients in dish
*/
public ArrayList<String> getIngredients() {
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/Menu.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class Menu {

/**
* Hashmap of all dishes on menu
* Hashmap of all dishes on menu.
*/
private static HashMap<String, Dish> dishMap = new HashMap<String, Dish>();

/**
* Adds a dish to the menu based on the input string
* Adds a dish to the menu based on the input string.
* @param input input string that include dish name and ingredients in no specific order
*/
public static void addDish(String input) {
Expand All @@ -21,15 +20,15 @@ public static void addDish(String input) {
}

/**
* Removes dish from menu
* Removes dish from menu.
* @param name name of dish to remove
*/
public static void deleteDish(String name) {
dishMap.remove(name);
}

/**
* Parses ingredients from string
* Parses ingredients from string.
* @param input string of ingredients
* @return ArrayList of ingredients
*/
Expand All @@ -45,7 +44,7 @@ public static ArrayList<String> parseIngredients(String input) {
}

/**
* Parses name from input string
* Parses name from input string.
* @param input input string
* @return name of dish
*/
Expand All @@ -56,7 +55,7 @@ public static String parseName(String input) {
}

/**
* Print's dishes out from dishMap
* Print's dishes out from dishMap.
*/
public static void printDishes() {
for (String name: dishMap.keySet()) {
Expand All @@ -70,7 +69,7 @@ public static void printDishes() {
}

/**
* Return's dishMap hashmap
* Return's dishMap hashmap.
* @return dishmap hashmap
*/
public static HashMap<String, Dish> getDishMap() {
Expand Down

0 comments on commit 1263e64

Please sign in to comment.