introExam.LinkedList
Class LL

java.lang.Object
  extended byintroExam.LinkedList.LL
Direct Known Subclasses:
ExtendedLL

public class LL
extends java.lang.Object

A minimal LL class using a nested LLNode class, for the 15-111/200 Final Exam/Fall 2004

Students are not permitted to modify or augment this class in any way. This file must not change.

Note that all instance variables declared in the nested LLNode class are public and that value is also declared with the final access modifier.

Thus, the information that they store can be accessed through these names directly, or through the provided getters/setters (except value cannot be changed once it has been initialized, and it has no setter).


Nested Class Summary
protected  class LL.LLNode
           
 
Field Summary
protected  LL.LLNode head
           
 
Constructor Summary
LL()
          Default constructor: creates empty list
 
Method Summary
 void addFirst(java.lang.Comparable value)
          Inserts a value at the beginning of the list.
 java.lang.String toString()
          Returns a string representation of the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

protected LL.LLNode head
Constructor Detail

LL

public LL()
Default constructor: creates empty list

Method Detail

addFirst

public void addFirst(java.lang.Comparable value)
Inserts a value at the beginning of the list.

Parameters:
value - to be added as the head of the list

toString

public java.lang.String toString()
Returns a string representation of the list

Returns:
String