package beans;
import java.lang.String.*;
import java.util.*;
import com.calendar.*;


public class CombinedSched {
   private ArrayList<String> schedAL = new ArrayList<String>();

   // JavaBean accessors for row
   public void setCombinedSched(String oneSched) {
      schedAL.add(oneSched);
   }
   public String getCombinedSched() {
      Controller myCont = new Controller(schedAL);
      String startString= myCont.funnelData();
      StringBuffer outSB = new StringBuffer();
      String daysArr [] = new String[5];
      startString = startString.replace(",", ""); // remove commas
      startString = startString.replace(":", "</td>");
      startString = startString.replace("1","<td bgcolor = 'red'> </td>");
      startString = startString.replace("0","<td bgcolor = 'blue'> </td>");
      daysArr = startString.split(";");
      for (int i=0; i<5; i++) {
          outSB.append("<tr><td>" + daysArr[i] + "</tr>");
       }
      return outSB.toString();
   }

}