// A Simple Test Program
import java.util.*;
import java.text.*;
import java.io.*;

// This is just a test driver for the Building, Room, and Meeting classes
public class Meetings
  {
  public static void main(String args[]) {
    // Create the building
    Building bldg = new Building();
    // Create the two rooms
    Building.Room room1 = new Building.Room("Conference A",10);
    Building.Room room2 = new Building.Room("Conference B",30);
    // add the rooms
    bldg.add(room1);
    bldg.add(room2);
    // Now some sample meetings
    try {
      Meeting m1 = new Meeting("Status","Al",
          "3 Dec 2000 08:00","3 Dec 2000 09:00",5);
      Meeting m2 = new Meeting("Review","Amit",
          "3 Dec 2000 08:30","3 Dec 2000 10:00",25);
      Meeting m3 = new Meeting("Edits","Elisa",
          "3 Dec 2000 09:30","3 Dec 2000 11:00",3);
    // Schedule meetings
      if (!bldg.schedule(m1))
        System.out.println("Can't schedule first meeting");
      if (!bldg.schedule(m2))
        System.out.println("Can't schedule second meeting");
      if (!bldg.schedule(m3))
        System.out.println("Can't schedule third meeting");
      }
    catch (ParseException e) {
      System.out.println("Bad date/time format:" + e);
      System.exit(1);
      }

    // print out schedule
    bldg.printSchedule(System.out);
    }
  }