I am getting this compilation error in the sectionArrayList<Recipe> tempRecipes = new ArrayList<Recipe>(recipesKnown); as well as the end of my program below(this is part of a bigger file that I cut out most of for simplicity):
private Collection<Recipe> recipesKnown;
private Collection<Ingredient> itemsOwned;
private Collection<Store> nearbyStores;
public MealPlanner(Collection<Recipe> recipesKnown, Collection<Ingredient> itemsOwned, Collection<Store> nearbyStores) {
recipesKnown = new ArrayList<Recipe>();
itemsOwned = new HashSet<Ingredient>();
nearbyStores = new ArrayList<Store>();
}
private Collection<Recipe> createTempRecipes() {
ArrayList<Recipe> tempRecipes = new ArrayList<Recipe>(recipesKnown);
for(Ingredient ing : itemsOwned) {
double ownedAmount = ing.getAmount();
for(Recipe recipe : tempRecipes) {
ArrayList<Ingredient> neededIngredients = new ArrayList<Ingredient>(recipe.getIngredients()); //get the ingredients for each recipe
for(Ingredient ingredient : neededIngredients) {
double neededAmount = ingredient.getAmount();
if(neededIngredients.contains(ing) && neededAmount <= ownedAmount) {
neededIngredients.remove(ing);
}
else {
neededAmount -= ing.getAmount();
}
}
}
}
return tempRecipes;
}
ArrayList<Recipe> tempRecipes = new ArrayList<Recipe>(createTempRecipes());```
Besides this, everything else works fine. Any help would be appreciated!