Class BooksLinkedList

java.lang.Object
  |
  +--BooksLinkedList

public class BooksLinkedList
extends java.lang.Object

Class BooksLinkedList is an alternate implementation of the LinkedList example given in Section 3.2.3 of the text book. The differences between this implementation and the book's are the following:

  1. no package declarations
  2. local ListNode class insted of separate ListNode class file
  3. no iterator class
  4. length data field used to keep track of the list length
  5. toString method instead of printList
  6. javadoc documentation provided


Constructor Summary
BooksLinkedList()
          Construct a new empty list.
 
Method Summary
 boolean isEmpty()
          Return true if this is empty, false if not.
 void makeEmpty()
          Make this empty.
 java.lang.String toString()
          Generate the string representation of this as a space-delimted sequence of elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooksLinkedList

public BooksLinkedList()
Construct a new empty list.
Method Detail

isEmpty

public boolean isEmpty()
Return true if this is empty, false if not.

makeEmpty

public void makeEmpty()
Make this empty.

toString

public java.lang.String toString()
Generate the string representation of this as a space-delimted sequence of elements.
Overrides:
toString in class java.lang.Object