import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * Some experiments to better understand Vector-based Lists
 */
public class TestRVBL
{
  public static void main(String[] args)
    throws Exception
  {
    // Prepare input and screenput.
    BufferedReader keyboard = 
      new BufferedReader(new InputStreamReader(System.in));
    PrintWriter screen = new PrintWriter(System.out, true);

    // Create a list and print it out.
    MutableList lst = new ReversedVectorBasedList();
    screen.println(lst);
    for (int i = 9; i > 0; i--) {
      lst.addToFront(new Integer(i));
      screen.println(lst);
    }//for

    // The next two lines build and print an infinitely recursive structure
    // That's not a good idea.
    // lst.addToFront(lst);
    // screen.println(lst);

    // Remove a few lines
    for (int i = 0; i < 5; i++) {
      screen.println("Deleting ... " + lst.removeFirst());
      screen.println(lst);
    } // for

		// That's it, we're done.
    System.exit(0);
  } // main(String[])

} // class TestVBL

