package rebelsky.list; /** * Things that indicate positions in a list and can move. Cursors * start at the front of the list. * * @author CSC152 2004F */ public interface Cursor extends SimpleCursor { /** * Reset the cursor to the front of the list. */ public void toFront(); /** * Reset the cursor to the rear of the list. */ public void toRear(); /** * Determine if the cursor is still valid. */ public boolean isValid(); /** * Get the value "under" the cursor. */ public Object get(); /** * Advance the cursor to the next object. Return that object. * * @pre * Must not be at the rear of the list. */ public Object next(); /** * Retreat the cursor to the previous object and return that * object. * * @pre * Must not be at the front of the ist. */ public Object prev(); /* * Determine if the cursor has any previous elements. */ public boolean hasPrev(); /** * Determine if the cursor has any remaining elements. */ public boolean hasNext(); } // interface Cursor