RetroLinkedList.java provides a 1.1 version of LinkedList which implements some of the Java 1.2 List interface
Default constructorPostcondition: Empty list is constructed.
Add an element to the list at a given position.Precondition: the position is valid.
Postcondition: object has been inserted in the correct position.
Add an element to the list.Postcondition: object has been added to the end of the list.
Return: true if the add was successful.
Clear the list.Postcondition: the list is empty.
Make a shallow copy of the list.Return: a clone of the list.
Does the list contain the element.Return: a true if and only if elem is in the list.
What is the position of the first occurrence of an element in the list.Return: if elem is in the list return its first position, otherwise return -1.
What is the position of the last occurrence of an element in the list.Return: if elem is in the list return its last position, otherwise return -1.
Size accessorReturn: number of elements in the list
Check if list is emptyReturn: true if list is empty, and false otherwise
Get an object at a given location.Precondition: the index is valid.
Return: the element at the given index.
Change the object at a given location.Precondition: the index is valid.
Precondition: the element at the given index has been changed to element.
Return: the old element at the given position.
Change the object at a given location.Precondition: the index is valid.
Precondition: the element at the given index has been changed to element.
Return: the old element at the given position.
Back to the package documentation index