import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Recipe {
private String name; //Recipe name
private String style; //Cuisine such as: Sichuan cuisine, Hunan cuisine, etc.
private int time; / /Cooking time in minutes
private String[] food; //Ingredients
private String[] step; //Operation steps
public Recipe() {< /p>
}
public Recipe(String name, String style, int time, String[] food, String[] step) {
this.name = name;
this.style = style;
this.time = time;
this.food = food;
this.step = step;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public int getTime() {
return time;
}
public void setTime(int time) {
this.time = time;
}
public String[] getFood() {
return food;
}
public void setFood(String[] food) {
this.food = food;
}
public String[] getStep() {
return step;
}
public void setStep(String[] step) {
this.step = step;
< p>}@Override
public String toString() {
String foods="";
for (String f : food) {
foods+=f+" ";
}
String steps="";
for (int i = 0 ; i < step.length; i++) {
steps += (i+1)+"."+step[i];
if(i!=step.length -1){
steps+=";";
}
}
return "Recipe name:" + name +< /p>
"\nCuisine:" + style +
"\nDuration:" + time +
"\nIngredients required:" + foods +< /p>
"\nOperation steps:" + steps;
}
public static void print(Recipe[] recipes){
for (Recipe recipe : recipes) {
System.out.println(recipe);
}
}
public static Recipe[ ] searchRecipesContainName(Recipe[] recipes, String name){
List
for (Recipe recipe : recipes) {
p>if(recipe.getName().contains(name)){
list.add(recipe);
}
}< /p>
return list.toArray(new Recipe[list.size()]);
}
public static Recipe[] searchRecipes(Recipe[] recipes, String style){
List
for (Recipe recipe : recipes) {
if(recipe. getStyle().equals(style)){
list.add(recipe);
}
}
return list. toArray(new Recipe[list.size()]);
}
public static Recipe[] searchRecipeLessThan(Recipe[] recipes, int time){
List
for (Recipe recipe : recipes) {
if(recipe.getTime()
1. Material: 6 grams of bird's nest, 0/0 gram of tremella fuciformis, 6 grams of Jin Yan, and appropriate a