Crop.java [src/nodes] 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 nodes;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.xml.sax.SAXException;
import static utils.Constants.ID;
import static utils.Constants.NAME;
import utils.TranslatorException;
/**
*
* @author Brad
*/
public abstract class Crop {
protected String name;
protected String id;
protected double targetYield;
public String getName() {
return name;
}
public String getID() {
return id;
}
public void setID(String key) {
id = key;
}
public double getYield() {
return targetYield;
}
public void setYield(double yield) {
targetYield = yield;
}
public void readJSONData(JSONObject jcrop) throws JSONException {
name = jcrop.getString(NAME);
id = jcrop.getString(ID);
}
public abstract void parseLMODData(JSONObject data) throws XMLStreamException, ParserConfigurationException, SAXException, IOException, TranslatorException, JSONException;
}