TableSaCatalog.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 java.util.ArrayList;
import java.util.Arrays;

/**
 *
 * @author scase
 */
public class TableSaCatalog extends Table {

    public static final String TABLE_NAME = "sacatalog";

    //Column Names
    public static final String AREASYMBOL_NAME = "areasymbol";
    public static final String AREA_NAME = "areaname";
    public static final String SA_VERSION = "saversion";
    public static final String SA_VER_EST = "saverest";

    private static final String[] AREASYMBOL = {AREASYMBOL_NAME, "A symbol that uniquely identifies a single occurrence of a particular type of area (e.g. Lancaster Co., Nebraska is NE109)"};
    private static final String[] AREA_NAME_DATA = {AREA_NAME, "The name given to the specified geographic area."};
    private static final String[] SA_VERSION_DATA = {SA_VERSION, "A sequential integer number used to denote the overall serial version of the data (tabular and/or spatial) for a soil survey area."};
    private static final String[] SA_VER_EST_DATA = {SA_VER_EST, "The date and time that a particular version of data (tabular and/or spatial) for the soil survey area was established."};

    /**
     * This ArrayList contains a static list of columns for this table that are
     * required regardless of the calling program's preferences. This columns
     * typically identify indexes and foreign keys and other relational aspects
     * of a table that must be maintained for data integrity.
     *
     * @see Table#getMandatoryColumns()
     * @see #getMandatoryColumns()
     */
    protected static ArrayList<String> MANDATORY_COLUMNS = new ArrayList<String>(Arrays.asList(SA_VERSION, SA_VER_EST));

    /**
     * Constructor
     */
    public TableSaCatalog() {
        tableName = TABLE_NAME;

        addDataColumn(AREASYMBOL_NAME, new TableColumnString(AREASYMBOL));
        addDataColumn(AREA_NAME, new TableColumnString(AREA_NAME_DATA));
        addDataColumn(SA_VERSION, new TableColumnInteger(SA_VERSION_DATA));
        addDataColumn(SA_VER_EST, new TableColumnString(SA_VER_EST_DATA));
    }

    @Override
    protected ArrayList<String> getMandatoryColumns() {
        return MANDATORY_COLUMNS;
    }

    /**
     *
     * @return
     */
    public String areaname() {
        return ((String) columns.get(AREA_NAME).getValue());
    }

    /**
     *
     * @param value
     */
    public void areaname(String value) {
        columns.get(AREA_NAME).setValue(value);
    }

    public String areasymbol() {
        return ((String) columns.get(AREASYMBOL_NAME).getValue());
    }

    /**
     *
     * @param value
     */
    public void areasymbol(String value) {
        columns.get(AREASYMBOL_NAME).setValue(value);
    }

    public int saversion() {
        return ((int) columns.get(SA_VERSION).getValue());
    }

    /**
     *
     * @param value
     */
    public void saversion(int value) {
        columns.get(SA_VERSION).setValue(value);
    }

    public String saversionest() {
        return ((String) columns.get(SA_VER_EST).getValue());
    }

    /**
     *
     * @param value
     */
    public void saversionest(String value) {
        columns.get(SA_VER_EST).setValue(value);
    }
}