|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLinkedList<T>
public class LinkedList<T>
Constructor Summary | |
---|---|
LinkedList()
Creates an empty linked list. |
Method Summary | |
---|---|
boolean |
add(int index,
T newData)
Adds the given data to the linked list. |
boolean |
delete(int index)
Deletes data at position index from the linked list. |
T |
getData(int index)
Returns the data at the given index of the linked list. |
int |
getLength()
Gets the length (i.e., number of data elements) in the list. |
void |
printList()
Prints all the data in the linked list to the screen, in order of index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinkedList()
Method Detail |
---|
public T getData(int index)
index
- Index of data to be returned, 0 = head.
public boolean add(int index, T newData)
index
- Index where the new data is addednewData
- New data to add to the list
public boolean delete(int index)
index
- Index of data to be deleted.
public int getLength()
public void printList()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |