package ca.teamTen.recitopia;

import java.util.ArrayList;


public class Recipe
{

	private String recipeName;
	private ArrayList<String> ingredients;
	private String cookingInstruction;
	private String author;
	private boolean isPublished;
	private ArrayList<Photo> photos;
	
	// Recipe constructor
	public Recipe(String recipeName, ArrayList<String> ingredients, String instruction, String author) {
		this.recipeName = recipeName;
		this.ingredients = ingredients;
		this.cookingInstruction = instruction;
		this.author = author;
		this.photos = new ArrayList<Photo>();
	}
	
	public String getRecipeName() {
		return this.recipeName;
	}
	
	public String showAuthor() {
		return this.author;
	}
	
	public ArrayList<String> showIngredients() {
		return this.ingredients;
	}
	
	public String showCookingInstructions() {
		return this.cookingInstruction;
	}
	

	public Photo[] getPhotos() {
		return (Photo[]) this.photos.toArray(new Photo[photos.size()]);
	}
	
	public void addPhotos(Photo photo) {
		this.photos.add(photo);
	}

	public boolean publishRecipe() {
		return false;
	}
	

}

@@ -52,16 +52,64 @@
 ayList;%0A
+import java.util.HashSet;%0Aimport java.util.Set;%0A
 %0A%0Apublic
@@ -124,17 +124,16 @@
 ecipe%0A%7B%0A
-%0A
 %09private
@@ -481,27 +481,79 @@
 ;%0A%09%09
-this.ingredients = 
+if (ingredients != null) %7B%0A%09%09%09this.ingredients = new ArrayList%3CString%3E(
 ingr
@@ -559,18 +559,81 @@
 redients
+)
 ;%0A
+%09%09%7D else %7B%0A%09%09%09this.ingredients = new ArrayList%3CString%3E();%0A%09%09%7D%0A
 %09%09this.c
@@ -1012,18 +1012,16 @@
 tion;%0A%09%7D
-%0A%09
 %0A%0A%09publi
@@ -1238,11 +1238,593 @@
 e;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * Checks for equality of all members.%0A%09 * @return true if all members are equal%0A%09 */%0A%09public boolean equalData(Recipe other) %7B%0A%09%09if (other == null) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A%09%09Set%3CString%3E myIngredients = new HashSet%3CString%3E(ingredients);%0A%09%09for (String ingredient: other.ingredients) %7B%0A%09%09%09if (!myIngredients.contains(ingredient)) %7B%0A%09%09%09%09return false;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09return recipeName.equals(other.recipeName)%0A%09%09%09%09&& cookingInstruction.equals(other.cookingInstruction)%0A%09%09%09%09&& author.equals(other.author)%0A%09%09%09%09&& (isPublished == other.isPublished)%0A%09%09%09%09;%0A%09%09// TODO: check photos?%0A%09%7D
 %0A%7D%0A

Add method for checking equality of Recipes.