import java.awt.*;
import java.util.*;
import javax.swing.*;

//this is the Implementor class
//that decides which class to return
public class listBridge extends Bridger {
   
  public static final int LIST=1, TABLE=2;
  protected visList list;

  public listBridge(int type) {
     setLayout(new BorderLayout());
      switch (type) {
      case LIST:
         list =  new productList();
         add("Center", (JComponent)list);
         break;
      case TABLE:
         list = new productTable();
         add("Center", (JComponent)list);
          break;
      default:
         list = null;
      }
      
   }  
  public void addData(Vector v) {
     for(int i=0; i<v.size(); i++) {
        String s = (String)v.elementAt (i);
        list.addLine (s);
     }
  }

}
