package pcm_Metric;

import java.util.List;
import java.util.logging.Logger;

import org.opencompare.api.java.AbstractFeature;
import org.opencompare.api.java.Cell;
import org.opencompare.api.java.PCM;
import org.opencompare.api.java.Product;
import org.opencompare.api.java.Value;
import org.opencompare.model.BooleanValue;


public class PCMInfoContainer {

	private static final Logger _log = Logger.getLogger(PCMInfoContainer.class.getName());
	
	private PCM pcm;

	private int rows;
	private int columns;

	public PCMInfoContainer(PCM pcm) {
		this.pcm = pcm;
		this.print();
	}
	
	public PCMInfoContainer(PCM pcm,Boolean compute) {
		this.pcm = pcm;
		this.print();
		if(compute){
			computeRows();
			computeColumns();
		}
	}

	public void print() {
		for (Product product : pcm.getProducts()) {
			List<Cell> cells = product.getCells();
			for (Cell cell : cells) {
				Value v = cell.getInterpretation();
				if (v instanceof BooleanValue) {
					_log.info("boolean");
				}
			}
		}
	}

	public void computeRows() {
		rows = 0;
		for (Product product : pcm.getProducts()) {
			rows++;
			// System.out.println(product.getKeyContent());
		}
		// System.out.println(rows);
	}

	public void computeColumns() {
		columns = 0;
		for (AbstractFeature feature : pcm.getFeatures()) {
			columns++;
			// System.out.println(feature.getName());
		}
		// System.out.println(columns);
	}

	public int getRows() {
		return rows;
	}

	public int getColumns() {
		return columns;
	}
}

@@ -523,16 +523,97 @@
 olumns;%0D
+%0A%09private int cells;%0D%0A%09private int emptyCells;%0D%0A%09private int uncompleteProducts;%0D
 %0A%0D%0A%09publ

add some metrics