|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Nodelist
Nodelist is a manager Object for a linked list. It uses the Node
class datastructure as buildingblocks for this list.
Author: Neil Short
Constructor Summary | |
Nodelist()
Construct a list with no data elements. |
Method Summary | |
void |
append(java.lang.Object r)
Add data r to the end of the linked list. |
void |
deleteAt(int n)
Remove the element at position n. |
void |
deleteNode(Node n)
Delete the Node arguement from the linked list Nodelist. |
Iterator |
getIterator()
Build and return an Iterator that accesses this instance of the linked list. |
int |
getLength()
Return the number of elements in the list. |
Node |
gotopos(int n)
Return the Node at position n. |
void |
insertAt(java.lang.Object r,
int n)
Insert a piece of data into the list at position n. |
void |
makeempty()
This method empties the linked list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Nodelist()
Method Detail |
public void makeempty()
public Iterator getIterator()
Iterator
that accesses this instance of the linked list.
public void append(java.lang.Object r)
public Node gotopos(int n)
deleteNode()
method.
One more caution is in order. The position indicated starts counting at 1 and not 0; so the first element in the list is at position 1.
This method was originally private. I still have reservations about making it public.
public void insertAt(java.lang.Object r, int n)
public void deleteAt(int n)
public void deleteNode(Node n)
public int getLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |