package ee.ut.math.tvt2008.salessystem.ui.model;

import ee.ut.math.tvt2008.salessystem.domain.data.SoldItem;

/**
 * Purchase history details model.
 */
public class PurchaseInfoTableModel extends SaleInfoTableModel {
	private static final long serialVersionUID = 1L;

    
    public Object getValueAt(int rowIndex, int columnIndex) {
        SoldItem soldItem = (SoldItem) sale.getSoldItems().toArray()[rowIndex];
        switch(columnIndex){
            case 0: return soldItem.getId();
            case 1: return soldItem.getName();
            case 2: return soldItem.getQuantity();
            case 3: return soldItem.getPrice();
            case 4: return soldItem.getValue();
            default: return -1;
        }
    }

        
}
