import java.util.ArrayList;/** * Provides a simple to-do list. * * A to-do list is just a list of Strings. New items can be added * to the end of the list. Completed items can be removed from * the beginning of the list. * * @author Bryson Y. Hori * @version 06 April 2008 */public class ToDoList { private ArrayList<Object> list; public ToDoList() { list = new ArrayList<Object>(); } /** * Adds the given item to the end of this todo list. */ public void add(String item,int urgency) { ToDoListItem todo = new ToDoListItem(item,urgency); list.add(todo); } /** * Removes the first item from this todo list. * Returns the item so removed. If the list was empty, returns null instead. */ public String remove(int num) { if (list.size() > 0) { num += -1; return list.get(num).toString(); list.remove(num); }else { return null; } }