TableAoA.java [src/soils] 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;

import static soils.AoA.AOA_DRAINED;
import static soils.AoA.AOA_ID;
import static soils.AoA.NSLP;
import static soils.AoA.PSLP;
import static soils.AoA.SRP;
import static soils.AoA.PSARP;
import static soils.AoA.PSSRP;
import soils.db.tables.Table;
import soils.db.tables.TableColumnBoolean;
import soils.db.tables.TableColumnDouble;
import soils.db.tables.TableColumnString;

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

    private final String AOA_AREA = "AoA Area";

    private final String[] AOAID_DATA = {AOA_ID, "Area of analysis identifier"};
    private final String[] NSLP_DATA = {NSLP, "Soil leaching potential of the area of analysis"};
    private final String[] SRP_DATA = {SRP, "Soil runoff potential for the area of analysis"};
    private final String[] AOA_DRAINED_DATA = {AOA_DRAINED, "Whether this soil component instance is drained.  Generalized at the AoA level."};
    private final String[] PSLP_DATA = {PSLP, "Soil Pesticide Leaching Potential for the Area of Analysis"};
    private final String[] PSSRP_DATA = {PSSRP, "Soil Pesticide Solution Runoff Potential for the Area of Analysis"};
    private final String[] PSARP_DATA = {PSARP, "Soil Pesticide Adsorbed Runoff Potential for the Area of Analysis"};
    private final String[] AOA_AREA_DATA = {AOA_AREA, "Area of the AoA", "Acres", "%.3f"};

    public TableAoA() {
        columns.put(AOA_ID, new TableColumnString(AOAID_DATA));
        columns.put(AOA_DRAINED, new TableColumnBoolean(AOA_DRAINED_DATA));
        columns.put(NSLP, new TableColumnString(NSLP_DATA));
        columns.put(SRP, new TableColumnString(SRP_DATA));
        columns.put(PSLP, new TableColumnString(PSLP_DATA));
        columns.put(PSSRP, new TableColumnString(PSSRP_DATA));
        columns.put(PSARP, new TableColumnString(PSARP_DATA));
        columns.put(AOA_AREA, new TableColumnDouble(AOA_AREA_DATA));

    }

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

    public double aoa_area() {
        return ((double) columns.get(AOA_AREA).getValue());
    }

    public void aoa_id(String aoa_id) {
        columns.get(AOA_ID).setValue(aoa_id);
    }

    public String aoa_id() {
        return ((String) columns.get(AOA_ID).getValue());
    }

    public boolean aoa_is_drained() {
        return ((boolean) columns.get(AOA_DRAINED).getValue());
    }

    public void aoa_is_drained(boolean isDrained) {
        columns.get(AOA_DRAINED).setValue(isDrained);
    }

    public void aoa_nslp(String nslp) {
        columns.get(NSLP).setValue(nslp);
    }

    public String aoa_nslp() {
        return ((String) columns.get(NSLP).getValue());
    }

    public void aoa_srp(String srp) {
        columns.get(SRP).setValue(srp);
    }

    public String aoa_srp() {
        return ((String) columns.get(SRP).getValue());
    }

    public void aoa_pslp(String pslp) {
        columns.get(PSLP).setValue(pslp);
    }

    public String aoa_pslp() {
        return ((String) columns.get(PSLP).getValue());
    }

    public void aoa_pssrp(String pssrp) {
        columns.get(PSSRP).setValue(pssrp);
    }

    public String aoa_pssrp() {
        return ((String) columns.get(PSSRP).getValue());
    }

    public void aoa_psarp(String psarp) {
        columns.get(PSARP).setValue(psarp);
    }

    public String aoa_psarp() {
        return ((String) columns.get(PSARP).getValue());
    }

}