package net.woodyfolsom.cs6601.p2;

import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("ing-div")
public class IngredientDivision {
	@XStreamImplicit
	private List<Ingredient> ingredients;
	private String title;
	
	public boolean contains(Ingredient.TYPE ingredientType) {
		for (Ingredient ingredient : ingredients) {
			if (ingredient.isType(ingredientType)) {
				return true;
			}
		}
		return false;
	}
	public Ingredient getIngredient(int index) {
		return ingredients.get(index);
	}
	
	public int getIngredientsSize() {
		return ingredients.size();
	}
	
	public String getTitle() {
		return title;
	}
}
