Crop.java [src/java/m/wqm/nutappmgtscores] Revision: cdaf7e395ccc063ea3848164e6a18c0e090681d0  Date: Sat Jun 13 20:25:38 MDT 2015
package m.wqm.nutappmgtscores;

/**
 *
 * @author RUMPAL SIDHU
 */
import java.util.Date;
import csip.utils.Dates;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Crop {

    private int mgtCropId;
    private boolean lmod;
    private String cropPlantDate;
    private double cropYield;
    private String cropYieldUnits;
    private ArrayList<Nutrient> nutrientApplicationList;

    public Crop(int mgtCropId, boolean lmod, String cropPlantDate, double cropYield,
            String cropYieldUnits, ArrayList<Nutrient> nutrientApplicationList) {
        this.mgtCropId = mgtCropId;
        this.lmod = lmod;
        this.cropPlantDate = cropPlantDate;
        this.cropYield = cropYield;
        this.cropYieldUnits = cropYieldUnits;
        this.nutrientApplicationList = nutrientApplicationList;
    }

    public int getMgtCropId() {
        return mgtCropId;
    }

    public boolean getLmod() {
        return lmod;
    }

    public Date getCropPlantDate() throws Exception {
        String[] parse = cropPlantDate.split("-");
        Calendar date = new GregorianCalendar(Integer.parseInt(parse[0]), 
                Integer.parseInt(parse[1]) - 1, Integer.parseInt(parse[2]));
        return date.getTime();
    }

    public double getCropYield() {
        return cropYield;
    }

    public String getCropYieldUnits() {
        return cropYieldUnits;
    }

    public ArrayList getNutrientApplicationList() {
        return nutrientApplicationList;
    }
}