/* * class ObjectLinkedListInterface * * Created on Jun 4, 2007 * * by Donald Yessick */ /** * @author Donald Yessick * */ public interface CS220_LinkedList_Interface { /** * isEmpty returns the lists status * @return true if the list has no objects */ boolean isEmpty(); /** * append adds object to tail end of a list * @param object to be added to list */ void append(Object object); /** * prepend adds object to head of a list * @param object to be appended to list */ void prepend(Object object); /** * insert object to middle of list * @param object to be inserted * @param index number of preceeding items */ void insert(Object object, int index); /** * getCount returns the size of the list * @return a count of the objects in the list */ int getCount(); /** * removeHead deletes the head item in the list * @return the deleted object */ Object removeHead(); /** * removeTail deletes object from tail end of the list * @return the deleted object or null if empty */ Object removeTail(); /** * removeIndex deletes the item in the list indicated by position index * @param index number of objects preceeding targetr * @return deleted object or null */ Object removeIndex(int index); /** * retrieve fetches the item indcated by index * @param index number of objects preceeding target object * @return target object or null */ Object retrieve(int index); /** * peekHead fetches object at head of list * @return target object or null */ Object peekHead(); /** * peekTail fetches object at tail end of list * @return target object or null */ Object peekTail(); /** * visit each element using the visitor design pattern * visit * @param v the visitor implementing a visit(object) method */ void visit(CS220_Visitor_Interface v); }