All pastes #975043 Raw Edit

Someone

public java v1 · immutable
·published 2008-04-07 06:54 UTC
rendered paste body
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;  			}			  		}