CITS2200
Interface List

All Known Implementing Classes:
ListLinked

public interface List

Interface for List ADTs that use a window for Links

See Also:
WindowLinked

Method Summary
 void afterLast(WindowLinked w)
          put a window over after-last position
 void beforeFirst(WindowLinked w)
          put a window over before-first position
 Object delete(WindowLinked w)
          delete and return the object under a window, and place window over the next item
 Object examine(WindowLinked w)
          examine the object under a window
 void insertAfter(Object e, WindowLinked w)
          insert an item after a window
 void insertBefore(Object e, WindowLinked w)
          insert an item before a window
 boolean isAfterLast(WindowLinked w)
          check if the window is over the after-last position
 boolean isBeforeFirst(WindowLinked w)
          check if the window is over the before-first position
 boolean isEmpty()
          check if the list is empty
 void next(WindowLinked w)
          move a window to the next position
 void previous(WindowLinked w)
          move a window to the previous position
 Object replace(Object e, WindowLinked w)
          replace the object under a window
 

Method Detail

isEmpty

boolean isEmpty()
check if the list is empty

Returns:
true if the list is empty, false otherwise

isBeforeFirst

boolean isBeforeFirst(WindowLinked w)
check if the window is over the before-first position

Parameters:
w - the window
Returns:
true if the window is over before-first, false otherwise

isAfterLast

boolean isAfterLast(WindowLinked w)
check if the window is over the after-last position

Parameters:
w - the window
Returns:
true if the window is over after-last, false otherwise

beforeFirst

void beforeFirst(WindowLinked w)
put a window over before-first position

Parameters:
w - the window to place

afterLast

void afterLast(WindowLinked w)
put a window over after-last position

Parameters:
w - the window to place

next

void next(WindowLinked w)
          throws OutOfBounds
move a window to the next position

Parameters:
w - the window
Throws:
OutOfBounds - if the window is past the end of the list

previous

void previous(WindowLinked w)
              throws OutOfBounds
move a window to the previous position

Parameters:
w - the window
Throws:
OutOfBounds - if the window is before the start of the list

insertAfter

void insertAfter(Object e,
                 WindowLinked w)
                 throws OutOfBounds
insert an item after a window

Parameters:
e - the item to insert
w - the window
Throws:
OutOfBounds - if the window is past the end of the list

insertBefore

void insertBefore(Object e,
                  WindowLinked w)
                  throws OutOfBounds
insert an item before a window

Parameters:
e - the item to insert
w - the window
Throws:
OutOfBounds - if the window is before the start of the list

examine

Object examine(WindowLinked w)
               throws OutOfBounds
examine the object under a window

Parameters:
w - the window
Returns:
the object under the window
Throws:
OutOfBounds - if the window is outside the list

replace

Object replace(Object e,
               WindowLinked w)
               throws OutOfBounds
replace the object under a window

Parameters:
e - the new object
w - the window
Returns:
the object previously under the window
Throws:
OutOfBounds - if the window is outside the list

delete

Object delete(WindowLinked w)
              throws OutOfBounds
delete and return the object under a window, and place window over the next item

Parameters:
w - the window
Returns:
the object previously under the window
Throws:
OutOfBounds - if the window is outside the list