Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
PartyApp/Party_APP/src/model/foodAndMenu.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
79 lines (76 sloc)
1.85 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model; | |
public class foodAndMenu { | |
public String foodname; | |
//We need to add the image in the foodAndMenu Contructor | |
//to commit | |
public String descriptionfood; | |
public String recipe; | |
//Constructor | |
public foodAndMenu(String a,String s, String k){ | |
this.foodname=a; | |
this.descriptionfood=s; | |
this.recipe=k; | |
} | |
foodAndMenu appetizer; | |
foodAndMenu entree; | |
foodAndMenu desert; | |
foodAndMenu snack; | |
//Getters | |
public void setEntree(String x, String s, String k){ | |
entree.foodname=x; | |
entree.descriptionfood=s; | |
entree.recipe=k; | |
} | |
public void setappetizer(String x,String s, String k){ | |
appetizer.foodname=x; | |
appetizer.descriptionfood=s; | |
appetizer.recipe=k; | |
} | |
public void setdesert (String x,String s, String k){ | |
desert.foodname=x; | |
desert.descriptionfood=s; | |
desert.recipe=k; | |
} | |
public void setsnack(String x,String s, String k){ | |
snack.foodname=x; | |
snack.descriptionfood=s; | |
snack.recipe=k; | |
} | |
//Setters | |
public foodAndMenu getAppetizer(String k){ | |
if (appetizer.foodname.equalsIgnoreCase(k)){ | |
return appetizer; | |
} | |
else { | |
System.out.println("There is no such item on the menu"); | |
return null; | |
} | |
} | |
public foodAndMenu getDesert(String k){ | |
if (desert.foodname.equalsIgnoreCase(k)){ | |
return desert; | |
} | |
else { | |
System.out.println("There is no such item on the menu"); | |
return null; | |
} | |
} | |
public foodAndMenu getSnack(String k){ | |
if (snack.foodname.equalsIgnoreCase(k)){ | |
return snack; | |
} | |
else { | |
System.out.println("There is no such item on the menu"); | |
return null; | |
} | |
} | |
public foodAndMenu getEntree(String k){ | |
if (entree.foodname.equalsIgnoreCase(k)){ | |
return entree; | |
} | |
else { | |
System.out.println("There is no such item on the menu"); | |
return null; | |
} | |
} | |
} |