Crop.java [src/java/m/wqm/nutappmgtscores] Revision: 17f5fa228c72b9fd4277ecc5638642eeb3fba846 Date: Fri Jul 17 11:01:13 MDT 2015
package m.wqm.nutappmgtscores;
/**
*
* @author RUMPAL SIDHU
*/
import java.util.Date;
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;
}
//Getter methods
public int getMgtCropId() {
return this.mgtCropId;
}
public boolean getLmod() {
return this.lmod;
}
public Date getCropPlantDate() throws Exception {
String[] parse = this.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 this.cropYield;
}
public String getCropYieldUnits() {
return this.cropYieldUnits;
}
public ArrayList getNutrientApplicationList() {
return this.nutrientApplicationList;
}
}