DAT
Class LinkedListChar

java.lang.Object
  |
  +--DAT.LinkedListChar

public class LinkedListChar
extends java.lang.Object

A basic recursive (linked) list of chars.


Constructor Summary
LinkedListChar()
          Create an empty list.
 
Method Summary
 void delete()
          Delete a character from the front of the list.
 char examine()
          Examine the first item in the list.
 void insert(char c)
          Insert a character at the front of the list.
 boolean isEmpty()
          Test whether the list is empty.
 java.lang.String toString()
          construct a sting representation of the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkedListChar

public LinkedListChar()
Create an empty list.

Method Detail

isEmpty

public boolean isEmpty()
Test whether the list is empty.

Returns:
true if the list is empty, false otherwise

insert

public void insert(char c)
Insert a character at the front of the list.

Parameters:
c - the character to insert

examine

public char examine()
             throws Underflow
Examine the first item in the list.

Returns:
the first item in the list
Throws:
Underflow - if the list is empty

delete

public void delete()
            throws Underflow
Delete a character from the front of the list.

Throws:
Underflow - if the list is empty

toString

public java.lang.String toString()
construct a sting representation of the list

Overrides:
toString in class java.lang.Object
Returns:
the string representation