|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLinkedList<E>
public class LinkedList<E>
Constructor Summary | |
---|---|
LinkedList()
Creates an empty linked list. |
Method Summary | |
---|---|
boolean |
add(int position,
Node<E> newNode)
Adds a node to the list; the new node is at the given position. |
boolean |
delete(int position)
Deletes the node at the given position. |
E |
getData(int position)
Returns the data at the given position of the linked list. |
void |
printList()
Prints the elements of the list, one per line. |
int |
search(E target)
Searches the list for an element equal to the given element. |
int |
size()
Returns the number of nodes in the list. |
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 E getData(int position)
position
- Position of data to be returned
public boolean add(int position, Node<E> newNode)
position
- Position of new nodenewNode
- New node to be added to the list
public boolean delete(int position)
position
- Position to delete
public int size()
public void printList()
public int search(E target)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |