TableComponent.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 <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
 */
public class TableComponent extends Table {

  public static final String TABLE_NAME = "component";
  //  Table Column Name Constants
  public static final String COKEY = "cokey";
  public static final String COMPKIND = "compkind";
  public static final String COMPNAME = "compname";
  public static final String COMPPCT_R_NAME = "comppct_r";
  public static final String HYDGRP_NAME = "hydgrp";
  public static final String LOCALPHASE_NAME = "localphase";
  public static final String OTHERPH_NAME = "otherph";
  public static final String SLOPE_R_NAME = "slope_r";
  public static final String TAXORDER_NAME = "taxorder";
  public static final String SLOPELENUSLE_R = "slopelenusle_r";
  public static final String TFACT_NAME = "tfact";
  public static final String WEI_NAME = "wei";
  public static final String MUKEY = "mukey";
  public static final String SLOPE_L = "slope_l";
  public static final String SLOPE_H = "slope_h";
  public static final String TAXSUBGRP = "taxsubgrp";
  public static final String SLOPELENUSLE_L = "slopelenusle_l";
  public static final String SLOPELENUSLE_H = "slopelenusle_h";
  public static final String ALBEDODRY_R = "albedodry_r";
  public static final String ALBEDODRY_L = "albedodry_l";
  public static final String ALBEDODRY_H = "albedodry_h";
  public static final String MAJ_COMP_FLAG = "majcompflag";
  public static final String RS_PROD_R = "rsprod_r";
  public static final String RS_PROD_L = "rsprod_l";
  public static final String RS_PROD_H = "rsprod_h";
  public static final String HYDRICRATING = "hydricrating";
  public static final String DRAINAGECL = "drainagecl";
  public static final String TAXPARTSIZE = "taxpartsize";
  public static final String EROCL = "erocl";
  public static final String RUNOFF = "runoff";

  static final String[] COMPPCT_R = {COMPPCT_R_NAME, "The percentage of the component of the mapunit", "Percent", "%.2f"};
  static final String[] HYDGRP = {HYDGRP_NAME, "A group of soils having similar runoff potential under similar storm and cover conditions. Examples are A and A/D. (NSSH)"};
  static final String[] KEY = {COKEY, "A non-connotative string of characters used to uniquely identify a record in the Component table"};
  static final String[] KIND = {COMPKIND, "Identifies the kind of component of the mapunit. Examples are series and miscellaneous areas"};
  static final String[] LOCALPHASE = {LOCALPHASE_NAME, "Phase criterion to be used at a local level, in conjunction with \"component name\" to help identify a soil component"};
  static final String[] NAME = {COMPNAME, "Name assigned to a component based on its range of properties"};
  static final String[] OTHERPH = {OTHERPH_NAME, "Phase criterion other than slope, texture, and flooding used to identify soil components"};
  static final String[] SLOPE_R = {SLOPE_R_NAME, "Slope RV: The difference in elevation between two points, expressed as a percentage of the distance between those points. (SSM)", "Percent", "%.2f"};
  static final String[] TAXORDER = {TAXORDER_NAME, "The highest level in Soil Taxonomy"};
  static final String[] SLOPELENUSLE_R_DATA = {SLOPELENUSLE_R, "The distance from the point of origin of overland flow to the point where either the slope gradient decreases enough that deposition begins, or the runoff water enters a well-defined channel that may be part of a drainage network or a constructed channel. (Predicting Rainfall Erosion Losses a Guide to Conservation Planning, Agr. Handbook #537, USDA, 1978).", "Meters", "%.2f"};
  static final String[] TFACT = {TFACT_NAME, "Soil loss tolerance factor. The maximum amount of erosion at which the quality of a soil as a medium for plant growth can be maintained", "", "%.2f"};
  static final String[] WEI = {WEI_NAME, "A value in tons/acre/year that is a factor in calculating soil loss by wind. The values are acquired from WEG", "tons/acre/year", "%.2f"};
  static final String[] MUKEY_DATA = {MUKEY, "A non-connotative string of characters used to uniquely identify a record in the Mapunit table"};
  static final String[] SLOPE_L_DATA = {SLOPE_L, "The difference in elevation between two points, expressed as a percentage of the distance between those points. (SSM) Low value", "Percent", "%.2f"};
  static final String[] SLOPE_H_DATA = {SLOPE_H, "The difference in elevation between two points, expressed as a percentage of the distance between those points. (SSM) High value", "Percent", "%.2f"};
  static final String[] TAXSUBGRP_DATA = {TAXSUBGRP, "The fourth level of Soil Taxonomy. The subgroup is below great group and above family"};
  static final String[] SLOPELENUSLE_L_DATA = {SLOPELENUSLE_L, "Low value, the distance from the point of origin of overland flow to the point where either the slope gradient decreases enough that deposition begins, or the runoff water enters a well-defined channel that may be part of a drainage network or a constructed channel. (Predicting Rainfall Erosion Losses a Guide to Conservation Planning, Agr. Handbook #537, USDA, 1978)", "Meters", "%.2f"};
  static final String[] SLOPELENUSLE_H_DATA = {SLOPELENUSLE_H, "High value, the distance from the point of origin of overland flow to the point where either the slope gradient decreases enough that deposition begins, or the runoff water enters a well-defined channel that may be part of a drainage network or a constructed channel. (Predicting Rainfall Erosion Losses a Guide to Conservation Planning, Agr. Handbook #537, USDA, 1978)", "Meters", "%.2f"};
  static final String[] ALBEDODRY_R_DATA = {ALBEDODRY_R, "Mean value, the estimated ratio of the incident short-wave (solar) radiation that is reflected by the air dry, less than 2 mm fraction of the soil surface", "Ratio", "0.3f"};
  static final String[] ALBEDODRY_L_DATA = {ALBEDODRY_L, "Low value, the estimated ratio of the incident short-wave (solar) radiation that is reflected by the air dry, less than 2 mm fraction of the soil surface", "Ratio"};
  static final String[] ALBEDODRY_H_DATA = {ALBEDODRY_H, "High value, the estimated ratio of the incident short-wave (solar) radiation that is reflected by the air dry, less than 2 mm fraction of the soil surface", "Ratio"};
  static final String[] MAJ_COMP_FLAG_DATA = {MAJ_COMP_FLAG, "ndicates whether or not a component is a major component in the mapunit"};
  static final String[] RS_PROD_R_DATA = {RS_PROD_R, "The estimated annual potential production of range forage per year, RV"};
  static final String[] RS_PROD_L_DATA = {RS_PROD_L, "The estimated annual potential production of range forage per year, Low value"};
  static final String[] RS_PROD_H_DATA = {RS_PROD_H, "The estimated annual potential production of range forage per year, High value"};
  static final String[] HYDRICRATING_DATA = {HYDRICRATING, "A yes/no (true/false) field that indicates whether or not a map unit component is classified as a 'hydric soil'. If rated as hydric, the specific criteria met are listed in the Component Hydric Criteria table."};
  static final String[] DRAINAGECL_DATA = {DRAINAGECL, "Identifies the natural drainage conditions of the soil and refers to the frequency and duration of wet periods. An example of a drainage class is well drained"};
  static final String[] TAXPARTSIZE_DATA = {TAXPARTSIZE, "Particle-size classes are used as family differentiae. Particle-size refers to grain-size distribution of the whole soil and is not the same as texture. (Soil Taxonomy)."};
  static final String[] EROCL_DATA = {EROCL, "Class of accelerated erosion. (SSM)"};
  static final String[] RUNOFF_DATA = {RUNOFF, "Runoff potential class for the soil."};
  /**
   * 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()
   */
  static final ArrayList<String> MANDATORY_COLUMNS = new ArrayList<>(Arrays.asList(COKEY, MUKEY));

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

  public TableComponent() {
    tableName = TABLE_NAME;
    addDataColumn(ALBEDODRY_R, new TableColumnDouble(ALBEDODRY_R_DATA));
    addDataColumn(ALBEDODRY_R, new TableColumnDouble(ALBEDODRY_R_DATA));
    addDataColumn(ALBEDODRY_L, new TableColumnDouble(ALBEDODRY_L_DATA));
    addDataColumn(ALBEDODRY_H, new TableColumnDouble(ALBEDODRY_H_DATA));
    addDataColumn(COKEY, new TableColumnInteger(KEY));
    addDataColumn(COMPNAME, new TableColumnString(NAME));
    addDataColumn(COMPKIND, new TableColumnString(KIND));
    addDataColumn(COMPPCT_R_NAME, new TableColumnDouble(COMPPCT_R));
    addDataColumn(HYDGRP_NAME, new TableColumnString(HYDGRP));
    addDataColumn(LOCALPHASE_NAME, new TableColumnString(LOCALPHASE));
    addDataColumn(MAJ_COMP_FLAG, new TableColumnBoolean(MAJ_COMP_FLAG_DATA));
    addDataColumn(MUKEY, new TableColumnInteger(MUKEY_DATA));
    addDataColumn(OTHERPH_NAME, new TableColumnString(OTHERPH));
    addDataColumn(SLOPE_R_NAME, new TableColumnDouble(SLOPE_R));
    addDataColumn(SLOPE_L, new TableColumnDouble(SLOPE_L_DATA));
    addDataColumn(SLOPE_H, new TableColumnDouble(SLOPE_H_DATA));
    addDataColumn(SLOPELENUSLE_R, new TableColumnDouble(SLOPELENUSLE_R_DATA));
    addDataColumn(SLOPELENUSLE_L, new TableColumnDouble(SLOPELENUSLE_L_DATA));
    addDataColumn(SLOPELENUSLE_H, new TableColumnDouble(SLOPELENUSLE_H_DATA));
    addDataColumn(TAXORDER_NAME, new TableColumnString(TAXORDER));
    addDataColumn(TAXSUBGRP, new TableColumnString(TAXSUBGRP_DATA));
    addDataColumn(TFACT_NAME, new TableColumnDouble(TFACT));
    addDataColumn(WEI_NAME, new TableColumnDouble(WEI));
    addDataColumn(RS_PROD_R, new TableColumnInteger(RS_PROD_R_DATA));
    addDataColumn(RS_PROD_L, new TableColumnInteger(RS_PROD_L_DATA));
    addDataColumn(RS_PROD_H, new TableColumnInteger(RS_PROD_H_DATA));
    addDataColumn(HYDRICRATING, new TableColumnBoolean(HYDRICRATING_DATA));
    addDataColumn(DRAINAGECL, new TableColumnString(DRAINAGECL_DATA));
    addDataColumn(TAXPARTSIZE, new TableColumnString(TAXPARTSIZE_DATA));
    addDataColumn(EROCL, new TableColumnString(EROCL_DATA));
    addDataColumn(RUNOFF, new TableColumnString(RUNOFF_DATA));
  }

  public String runoff() {
    return ((String) columns.get(TableComponent.RUNOFF).getValue());
  }

  public void runoff(String value) {
    columns.get(TableComponent.RUNOFF).setValue(value);
  }

  public String drainagecl() {
    return ((String) columns.get(TableComponent.DRAINAGECL).getValue());
  }

  public void drainagecl(String value) {
    columns.get(TableComponent.DRAINAGECL).setValue(value);
  }

  public String erocl() {
    return ((String) columns.get(TableComponent.EROCL).getValue());
  }

  public void erocl(String value) {
    columns.get(TableComponent.EROCL).setValue(value);
  }

  public boolean majorComponent() {
    return ((boolean) columns.get(TableComponent.MAJ_COMP_FLAG).getValue());
  }

  public boolean hydricrating() {
    return ((boolean) columns.get(TableComponent.HYDRICRATING).getValue());
  }

  public void hydricrating(boolean value) {
    columns.get(TableComponent.HYDRICRATING).setValue(value);
  }

  public double albedodry_r() {
    return ((double) columns.get(TableComponent.ALBEDODRY_R).getValue());
  }

  public double albedodry_l() {
    return ((double) columns.get(TableComponent.ALBEDODRY_L).getValue());
  }

  public double albedodry_h() {
    return ((double) columns.get(TableComponent.ALBEDODRY_H).getValue());
  }

  public void albedodry_r(double value) {
    columns.get(TableComponent.ALBEDODRY_R).setValue(value);
  }

  public void albedodry_l(double value) {
    columns.get(TableComponent.ALBEDODRY_L).setValue(value);
  }

  public void albedodry_h(double value) {
    columns.get(TableComponent.ALBEDODRY_H).setValue(value);
  }

  public int rsprod_r() {
    return ((int) columns.get(TableComponent.RS_PROD_R).getValue());
  }

  public int rsprod_l() {
    return ((int) columns.get(TableComponent.RS_PROD_L).getValue());
  }

  public int rsprod_h() {
    return ((int) columns.get(TableComponent.RS_PROD_H).getValue());
  }

  public void rsprod_r(int value) {
    columns.get(TableComponent.RS_PROD_R).setValue(value);
  }

  public void rsprod_l(int value) {
    columns.get(TableComponent.RS_PROD_L).setValue(value);
  }

  public void rsprod_h(int value) {
    columns.get(TableComponent.RS_PROD_H).setValue(value);
  }

  public int mukey() {
    return ((int) columns.get(TableComponent.MUKEY).getValue());
  }

  public void mukey(int value) {
    columns.get(TableComponent.MUKEY).setValue(value);
  }

  public double slope_l() {
    return ((double) columns.get(TableComponent.SLOPE_L).getValue());
  }

  public double slope_h() {
    return ((double) columns.get(TableComponent.SLOPE_H).getValue());
  }

  public String taxsubgrp() {
    return ((String) columns.get(TableComponent.TAXSUBGRP).getValue());
  }

  public double slopelenusle_l() {
    return ((double) columns.get(TableComponent.SLOPELENUSLE_L).getValue());
  }

  public double slopelenusle_h() {
    return ((double) columns.get(TableComponent.SLOPELENUSLE_H).getValue());
  }

  public double slopelenusle_r() {
    return ((double) columns.get(TableComponent.SLOPELENUSLE_R).getValue());
  }

  public void slope_l(double value) {
    columns.get(TableComponent.SLOPE_L).setValue(value);
  }

  public void slope_h(double value) {
    columns.get(TableComponent.SLOPE_H).setValue(value);
  }

  public void taxsubgrp(String value) {
    columns.get(TableComponent.TAXSUBGRP).setValue(value);
  }

  public void slopelenusle_l(double value) {
    columns.get(TableComponent.SLOPELENUSLE_L).setValue(value);
  }

  public void slopelenusle_h(double value) {
    columns.get(TableComponent.SLOPELENUSLE_H).setValue(value);
  }

  public void slopelenusle_r(double value) {
    columns.get(TableComponent.SLOPELENUSLE_R).setValue(value);
  }

  public int cokey() {
    return ((int) columns.get(TableComponent.COKEY).getValue());
  }

  public void cokey(int cokey) {
    columns.get(TableComponent.COKEY).setValue(cokey);
  }

  public String compkind() {
    return ((String) columns.get(TableComponent.COMPKIND).getValue());
  }

  public void compkind(String compkind) {
    columns.get(TableComponent.COMPKIND).setValue(compkind);
  }

  public String compname() {
    return ((String) columns.get(TableComponent.COMPNAME).getValue());
  }

  public void compname(String compname) {
    columns.get(TableComponent.COMPNAME).setValue(compname);
  }

  public double comppct_r() {
    return ((double) columns.get(TableComponent.COMPPCT_R_NAME).getValue());
  }

  public void comppct_r(double comppct_r) {
    columns.get(TableComponent.COMPPCT_R_NAME).setValue(comppct_r);
  }

  public String hydgrp() {
    return ((String) columns.get(TableComponent.HYDGRP_NAME).getValue());
  }

  public void hydgrp(String hydgrp) {
    columns.get(TableComponent.HYDGRP_NAME).setValue(hydgrp);
  }

  public String localphase() {
    return ((String) columns.get(TableComponent.LOCALPHASE_NAME).getValue());
  }

  public void localphase(String localphase) {
    columns.get(TableComponent.LOCALPHASE_NAME).setValue(localphase);
  }

  public String otherph() {
    return ((String) columns.get(TableComponent.OTHERPH_NAME).getValue());
  }

  public void otherph(String otherph) {
    columns.get(TableComponent.OTHERPH_NAME).setValue(otherph);
  }

  public double slope_r() {
    return ((double) columns.get(TableComponent.SLOPE_R_NAME).getValue());
  }

  public void slope_r(double slope_r) {
    columns.get(TableComponent.SLOPE_R_NAME).setValue(slope_r);
  }

  public String taxorder() {
    return ((String) columns.get(TableComponent.TAXORDER_NAME).getValue());
  }

  public void taxorder(String taxorder) {
    columns.get(TableComponent.TAXORDER_NAME).setValue(taxorder);
  }

  public double tfact() {
    return ((double) columns.get(TableComponent.TFACT_NAME).getValue());
  }

  public void tfact(double tfact) {
    columns.get(TableComponent.TFACT_NAME).setValue(tfact);
  }

  public double wei() {
    return ((double) columns.get(TableComponent.WEI_NAME).getValue());
  }

  public void wei(double wei) {
    columns.get(TableComponent.WEI_NAME).setValue(wei);
  }

  public String taxpartsize() {
    return ((String) columns.get(TableComponent.TAXPARTSIZE).getValue());
  }

  public void taxpartsize(String value) {
    columns.get(TableComponent.TAXPARTSIZE).setValue(value);
  }

}