Inheritance diagram for javawrapper::PlantingBehaviors:
Public Member Functions | |
PlantingBehaviors (GUIManager oManager) | |
Constructor. | |
void | ReadOldHarvestRegimeFile (String sFileName, Plot oPlot, TreePopulation oPop) throws ModelException |
Reads in an old tab-delimited harvest regime file. | |
void | ValidateData (TreePopulation oPop) throws ModelException |
Validates the data prior to writing it. | |
void | WriteXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException |
Overridden because planting parameters are special. | |
void | DoSetup (TreePopulation oPop) throws javawrapper.ModelException |
Sets up the planting results grid. | |
Vector | FormatDataForDisplay (TreePopulation oPop) |
Ensures data is not displayed in parameter window. | |
boolean | SetVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, Vector p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, Attributes oParentAttributes, Attributes[] p_oAttributes) throws ModelException |
Sets a data vector's value. | |
void | ReadXMLParentTag (String sXMLTag, Attributes oAttributes) throws ModelException |
Accepts an XML parent tag (empty, no data) from the parser. | |
boolean | SetSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException |
This method looks for the following tags:. | |
void | ChangeOfSpecies (int iOldNumSpecies, int[] p_iIndexer) throws ModelException |
Checks planting settings upon change of species. | |
Static Public Attributes | |
static final int | GRIDDED = 1 |
Gridded planting. | |
static final int | RANDOM = 0 |
Random planting. | |
Protected Member Functions | |
Vector | AddPlantingData (Vector oList, PlantingData oNewPlanting) throws ModelException |
This adds the data contained in a PlantingData object to a list of planting data. | |
Protected Attributes | |
Vector | mp_oPlantings |
Our array of plantings. | |
ModelVector | mp_fInitialDiam10 |
Slope of growth response for each species. |
Copyright: Copyright (c) Charles D. Canham 2003
Company: Institute of Ecosystem Studies
javawrapper::PlantingBehaviors::PlantingBehaviors | ( | GUIManager | oManager | ) | [inline] |
Constructor.
oManager | GUIManager object. |
Vector javawrapper::PlantingBehaviors::AddPlantingData | ( | Vector | oList, | |
PlantingData | oNewPlanting | |||
) | throws ModelException [inline, protected] |
This adds the data contained in a PlantingData object to a list of planting data.
If there is data to be added, it is compared to existing PlantingData objects on the list. If they match except for the grid cell, then the new object's grid cell is added to the existing object and the new object thrown away. If it is truly new data, it is added to the list.
IMPORTANT: This assumes that abundances will be in species order, as they should be if reading a harvest regime file.
oList | The list of PlantingData objects to add to. | |
oNewPlanting | The PlantingData object to add. |
ModelException | Passing through underlying exceptions. |
void javawrapper::PlantingBehaviors::ChangeOfSpecies | ( | int | iOldNumSpecies, | |
int[] | p_iIndexer | |||
) | throws ModelException [inline] |
Checks planting settings upon change of species.
This will remove any deleted species.
iOldNumSpecies | says how many species there used to be. | |
p_iIndexer | is an array, sized to the new number of species. For each bucket (representing the index number of a species on the new list), the value is either the index of that same species in the old species list, or -1 if the species is new. |
ModelException | if anything goes wrong. |
Reimplemented from javawrapper::WorkerBase.
void javawrapper::PlantingBehaviors::DoSetup | ( | TreePopulation | oPop | ) | throws javawrapper.ModelException [inline, virtual] |
Sets up the planting results grid.
oPop | Tree population. |
javawrapper.ModelException | If anything goes wrong. |
Implements javawrapper::WorkerBase.
Vector javawrapper::PlantingBehaviors::FormatDataForDisplay | ( | TreePopulation | oPop | ) | [inline] |
Ensures data is not displayed in parameter window.
This behavior group has its own window for data entry.
oPop | Not used. |
Reimplemented from javawrapper::WorkerBase.
void javawrapper::PlantingBehaviors::ReadOldHarvestRegimeFile | ( | String | sFileName, | |
Plot | oPlot, | |||
TreePopulation | oPop | |||
) | throws ModelException [inline] |
Reads in an old tab-delimited harvest regime file.
Any existing planting data will be replaced with what's in the file.
sFileName | Filename of harvest regime file. | |
oPlot | Plot object. | |
oPop | TreePopulation object. |
ModelException | Wrapping an IO exception, or if the harvest parameters do not match the currently loaded parameter file. |
void javawrapper::PlantingBehaviors::ReadXMLParentTag | ( | String | sXMLTag, | |
Attributes | oAttributes | |||
) | throws ModelException [inline] |
Accepts an XML parent tag (empty, no data) from the parser.
This method watches for the following tags:
sXMLTag | The XML tag. | |
oAttributes | The attributes of this object. |
ModelException | if there is a problem reading this data. |
Reimplemented from javawrapper::WorkerBase.
boolean javawrapper::PlantingBehaviors::SetSingleValueByXMLTag | ( | String | sXMLTag, | |
String | sXMLParentTag, | |||
Attributes | oAttributes, | |||
Object | oData | |||
) | throws ModelException [inline] |
This method looks for the following tags:.
sXMLTag | XML tag of data object whose value is to be set. | |
sXMLParentTag | The immediate parent tag that sXMLTag is within. | |
oAttributes | Attributes of the object. Ignored, but may be needed by overriding objects. | |
oData | Data value appropriate to the data type |
ModelException | if the value could not be assigned to the data object, or if the cut type or cut type amount values are unrecognized. |
Reimplemented from javawrapper::WorkerBase.
boolean javawrapper::PlantingBehaviors::SetVectorValueByXMLTag | ( | String | sXMLTag, | |
String | sXMLParentTag, | |||
Vector | p_oData, | |||
String[] | p_sChildXMLTags, | |||
boolean[] | p_bAppliesTo, | |||
Attributes | oParentAttributes, | |||
Attributes[] | p_oAttributes | |||
) | throws ModelException [inline] |
Sets a data vector's value.
This function looks for the parent tag "pl_amountToPlant".
sXMLTag | Parent XML tag of data vector whose value is to be set. | |
sXMLParentTag | The immediate parent tag that sXMLTag is within. | |
p_oData | Vector of data values appropriate to the data type | |
p_sChildXMLTags | The XML tags of the child elements | |
p_bAppliesTo | Array of booleans saying which of the vector values should be set. This is important in the case of species-specifics - the vector index is the species number but not all species are set. | |
oParentAttributes | Attributes of parent tag. May be useful when overridding this for unusual tags. | |
p_oAttributes | Attributes passed from parser. This may be needed when overriding this function. Basic species-specific values are already handled by this function. |
ModelException | if the value could not be assigned to the data object. |
Reimplemented from javawrapper::WorkerBase.
void javawrapper::PlantingBehaviors::ValidateData | ( | TreePopulation | oPop | ) | throws ModelException [inline, virtual] |
Validates the data prior to writing it.
It causes all PlantingData objects to validate themselves.
oPop | TreePopulation object |
ModelException | if one of the data objects is not valid. |
Implements javawrapper::WorkerBase.
void javawrapper::PlantingBehaviors::WriteXML | ( | BufferedWriter | jOut, | |
TreePopulation | oPop | |||
) | throws ModelException [inline] |
Overridden because planting parameters are special.
jOut | File to write to. | |
oPop | TreePopulation object. |
ModelException | if there's a problem writing the file. |
Reimplemented from javawrapper::BehaviorTypeBase.
final int javawrapper::PlantingBehaviors::GRIDDED = 1 [static] |
Gridded planting.
Matches old code enum value - important!
Initial value:
new ModelVector( "Avg. diameter at 10 cm for new seedlings", "pl_initialDiam10", "pl_idVal", 0, ModelVector.FLOAT)
final int javawrapper::PlantingBehaviors::RANDOM = 0 [static] |
Random planting.
Matches old code enum value - important!