|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCITS2200.ListLinked
public class ListLinked
Singly linked implementation of a List ADT
Constructor Summary | |
---|---|
ListLinked()
create a new list |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListLinked()
Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface List
public boolean isBeforeFirst(WindowLinked w)
isBeforeFirst
in interface List
w
- the window
public boolean isAfterLast(WindowLinked w)
isAfterLast
in interface List
w
- the window
public void beforeFirst(WindowLinked w)
beforeFirst
in interface List
w
- the window to placepublic void afterLast(WindowLinked w)
afterLast
in interface List
w
- the window to placepublic void next(WindowLinked w) throws OutOfBounds
next
in interface List
w
- the window
OutOfBounds
- if the window is past the end of the listpublic void previous(WindowLinked w) throws OutOfBounds
previous
in interface List
w
- the window
OutOfBounds
- if the window is before the start of the listpublic void insertAfter(Object e, WindowLinked w) throws OutOfBounds
insertAfter
in interface List
e
- the item to insertw
- the window
OutOfBounds
- if the window is past the end of the listpublic void insertBefore(Object e, WindowLinked w) throws OutOfBounds
insertBefore
in interface List
e
- the item to insertw
- the window
OutOfBounds
- if the window is before the start of the listpublic Object examine(WindowLinked w) throws OutOfBounds
examine
in interface List
w
- the window
OutOfBounds
- if the window is outside the listpublic Object replace(Object e, WindowLinked w) throws OutOfBounds
replace
in interface List
e
- the new objectw
- the window
OutOfBounds
- if the window is outside the listpublic Object delete(WindowLinked w) throws OutOfBounds
delete
in interface List
w
- the window
OutOfBounds
- if the window is outside the list
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |