// Path: src/org/drugepi/table/TableRowCol.java
// public enum RowColTypes { NORMAL, HEADER };


import java.util.*;
import org.drugepi.table.TableRowCol.RowColTypes;
import java.io.InputStream;
	
	public void addCell(TableCell cell) {
		cells.put(cell.id, cell);
	}
	
	public List<TableRowCol> getRowsColsAtLevel(List<TableRowCol> rcs, int level) {
		ArrayList<TableRowCol> rowsColsAtLevel = new ArrayList<TableRowCol>();
		
		for (TableRowCol rc: rcs) {
			if (TableRowCol.getDepth(rc) == level)
				rowsColsAtLevel.add(rc);
		}
		
		return rowsColsAtLevel;
	}
	
	public String getRowHtml(List<TableRowCol> rows, List<TableRowCol> leafCols, int level, int maxRowDepth) {
		StringBuffer html = new StringBuffer();
		ArrayList<TableRowCol> final_col_position = new ArrayList<TableRowCol>();
		
		for (TableRowCol row: rows) {
			boolean printTr = false;
			
			if ((row.parent == null) ||
				(row.parent.children.get(0) != row))
				printTr = true;
			
			if (printTr) 
				html.append("<tr>\n");
			
// Path: src/org/drugepi/table/TableRowCol.java
// public enum RowColTypes { NORMAL, HEADER };


// Path: src/org/drugepi/table/Table.java
import java.util.*;
import org.drugepi.table.TableRowCol.RowColTypes;
import java.io.InputStream;

	
	public void addCell(TableCell cell) {
		cells.put(cell.id, cell);
	}
	
	public List<TableRowCol> getRowsColsAtLevel(List<TableRowCol> rcs, int level) {
		ArrayList<TableRowCol> rowsColsAtLevel = new ArrayList<TableRowCol>();
		
		for (TableRowCol rc: rcs) {
			if (TableRowCol.getDepth(rc) == level)
				rowsColsAtLevel.add(rc);
		}
		
		return rowsColsAtLevel;
	}
	
	public String getRowHtml(List<TableRowCol> rows, List<TableRowCol> leafCols, int level, int maxRowDepth) {
		StringBuffer html = new StringBuffer();
		ArrayList<TableRowCol> final_col_position = new ArrayList<TableRowCol>();
		
		for (TableRowCol row: rows) {
			boolean printTr = false;
			
			if ((row.parent == null) ||
				(row.parent.children.get(0) != row))
				printTr = true;
			
			if (printTr) 
				html.append("<tr>\n");
			
			String rowClass = (row.rcType == RowColTypes.NORMAL ? "row_normal" : "row_header");