|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLinkedList<E>
public class LinkedList<E>
An Iterable list that is implemented using a singly-linked chain of nodes with a header node and without a tail reference. The "header node" is a node without a data reference that will reference the first node with data once data has been added to list. The iterator returned is a LinkedListIterator constructed by passing the first node with data. CAUTION: the chain of nodes in this class can be changed without calling the add and remove methods in this class. So, the size() method must be implemented by counting nodes. This counting must occur each time the size method is called. DO NOT USE a numItems field. COMPLETE THIS CLASS AND HAND IN THIS FILE
Constructor Summary | |
---|---|
LinkedList()
|
Method Summary | |
---|---|
Listnode<E> |
getHeaderNode()
Returns a reference to the header node for this linked list. |
LinkedListIterator<E> |
iterator()
Returns a reference to a LinkedListIterator for this list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ListADT |
---|
add, add, contains, get, isEmpty, remove, size |
Constructor Detail |
---|
public LinkedList()
Method Detail |
---|
public Listnode<E> getHeaderNode()
public LinkedListIterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |