TableMapUnitCalculations.java [src/soils/db/tables] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package soils.db.tables;

import csip.api.server.ServiceException;

/**
 *
 * @author <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
 */
public class TableMapUnitCalculations extends Table {

    // Calculated Column Names Constants
    public static final String AREA_NAME = "area";
    public static final String AREA_PCT = "percent_aoi_area";

    // Calculated Column Definitions
    private static final String[] AREA = {AREA_NAME, "Map unit intersection area with the AoI", "Acres", "%.3f"};
    private static final String[] AREA_PCT_DATA = {AREA_PCT, "The percentage of the AoI area that this map unit intersection makes up.", "Percent", "%.3f"};

    public TableMapUnitCalculations(){
        addDataColumn(AREA_NAME, new TableColumnDouble(AREA));
        addDataColumn(AREA_PCT, new TableColumnDouble(AREA_PCT_DATA));
        tableName = "mapunitCalculations";
    }

    public void area(double area) {
        columns.get(AREA_NAME).setValue(area);
    }

    public double area() {
        return ((double) columns.get(AREA_NAME).getValue());
    }

    public void area_pct(double value) {
        columns.get(AREA_PCT).setValue(value);
    }

    public double area_pct() {
        return ((double) columns.get(AREA_PCT).getValue());
    }
}