package taskDo;

import java.util.ArrayList;

public class CategoryList {

	//Members
	private static ArrayList<Category> categoryList;

	//Constructor
	private CategoryList() {

	}

	//Accessor
	public static ArrayList<Category> getCategoryList() {
		if(categoryList == null) {
			categoryList = new ArrayList<Category>();
		}
		return categoryList;
	}

	//Mutator
	public static boolean addCategory(String name) {
		categoryList.add(new Category(name));
		return true;
	}

	public static boolean deleteCategory(String name) {
		for(int i=0; i<categoryList.size(); i++) {
			if(categoryList.get(i).getName().toLowerCase().equals(name.toLowerCase())) {
				categoryList.remove(i);
				return true;
			}
		}
		return false;
	}

	//Extra methods
	public static boolean isExistingCatgory(String name) {
		for(int i=0; i<categoryList.size(); i++) {
			if(categoryList.get(i).getName().toLowerCase().equals(name.toLowerCase())) {
				return true;
			}
		}
		return false;
	}
	
}


@@ -359,39 +359,32 @@
 Mutator%0A%09public 
-static 
 boolean addCateg
@@ -461,39 +461,32 @@
 ue;%0A%09%7D%0A%0A%09public 
-static 
 boolean deleteCa
@@ -731,23 +731,16 @@
 %09public 
-static 
 boolean 

Fix for categoryList