public class CircularlyLinkedList<E> extends Object
| Constructor and Description | 
|---|
CircularlyLinkedList()
Constructs an initially empty list. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addFirst(E e)
Adds an element to the front of the list. 
 | 
void | 
addLast(E e)
Adds an element to the end of the list. 
 | 
E | 
first()
Returns (but does not remove) the first element of the list 
 | 
boolean | 
isEmpty()
Tests whether the linked list is empty. 
 | 
E | 
last()
Returns (but does not remove) the last element of the list 
 | 
E | 
removeFirst()
Removes and returns the first element of the list. 
 | 
void | 
rotate()
Rotate the first element to the back of the list. 
 | 
int | 
size()
Returns the number of elements in the linked list. 
 | 
String | 
toString()
Produces a string representation of the contents of the list. 
 | 
public CircularlyLinkedList()
public int size()
public boolean isEmpty()
public E first()
public E last()
public void rotate()
public void addFirst(E e)
e - the new element to addpublic void addLast(E e)
e - the new element to addpublic E removeFirst()