package rebelsky.list; /** * Things that indicate positions in a list. * * @author CSC152 2004F */ public interface Position { /** * Get the next position in the list. * * @return n * the next position. * @pre * This position is not at the back of the list. * @post * The previous position of n is this position. * @exception NoSuchPosition * If this position is at the front of the list. */ public Position next() throws NoSuchPosition; /** * Get the previous position in the list. * * @return p * the previous position. * @pre * This position is not at the front of the list. * @post * The next position of p is this position. * @exception NoSuchPosition * If this position is at the front of the list. */ public Position prev() throws NoSuchPosition; /** * Determine if this position is at the back of the list. */ public boolean atBack(); /** * Determine if this position is at the back of the list. */ public boolean atFront(); } // interface Position