Class LinkedList

java.lang.Object
   |
   +----LinkedList

public class LinkedList
extends Object
Doubly Linked List. Allows you to go forwards and backwards.

Version:
Version 2
Author:
Millie Ives

Constructor Index

 o LinkedList()

Method Index

 o append(Object)
Appends link object to the end of the link list.
 o atLastLink()
Resets true if current pointer is pointing to the last link.
 o currentElement()
Return the current linked list element.
 o getNextElement()
Returns the next element in the list.
 o getPreviousElement()
Returns the previous element in the linked list.
 o hasCurrElement()
 o hasMoreElements()
Returns true iff the current pointer is not at the end of the list.
 o hasNextElement()
Returns true iff current.next pointer is not null.
 o hasPreviousElement()
Returns true iff current.previous pointer is not null.
 o insert(Object)
Inserts object into the linked list after the current item.
 o remove()
Removes current element from the linked list Returns the removed object.
 o reset()
Resets the linked list to the head (first element).
 o setToTail()
Resets the linked list to the tail (last element).

Constructors

 o LinkedList
 public LinkedList()

Methods

 o reset
 public void reset()
Resets the linked list to the head (first element).

Returns:
None
 o hasMoreElements
 public boolean hasMoreElements()
Returns true iff the current pointer is not at the end of the list.

Returns:
boolean
 o hasNextElement
 public boolean hasNextElement()
Returns true iff current.next pointer is not null.

Returns:
boolean
 o hasPreviousElement
 public boolean hasPreviousElement()
Returns true iff current.previous pointer is not null.

Returns:
boolean
 o atLastLink
 public boolean atLastLink()
Resets true if current pointer is pointing to the last link. Had to add this so the player wouldn't keep playing the last packet.

Returns:
boolean
 o setToTail
 public void setToTail()
Resets the linked list to the tail (last element).

Returns:
None
 o getNextElement
 public Object getNextElement()
Returns the next element in the list.

Returns:
link Object
 o currentElement
 public Object currentElement()
Return the current linked list element.

Returns:
link Object
 o hasCurrElement
 public boolean hasCurrElement()
 o getPreviousElement
 public Object getPreviousElement()
Returns the previous element in the linked list.

Returns:
link Object
 o insert
 public void insert(Object n)
Inserts object into the linked list after the current item.

Parameters:
link - Object
Returns:
None
 o append
 public void append(Object n)
Appends link object to the end of the link list.

Parameters:
link - Object
Returns:
None
 o remove
 public Object remove()
Removes current element from the linked list Returns the removed object. Move the cursor to the next element if not null or, to the element before it if at the end of the list(after removal of the node).

Returns:
link Object
Throws: NoSuch
ElementException if already at the end of the list