Inheritance diagram for javawrapper::WorkerBase:
Public Member Functions | |
String | GetName () |
Returns the user-acceptable name for this object. | |
abstract void | DoSetup (TreePopulation oPop) throws ModelException |
Does any needed setup once the tree population object has data. | |
boolean | GetAutoDisplayParameters () |
Gets whether to auto-display this object's parameters. | |
String | GetHelpID () |
Gets this object's help ID, if it exists. | |
Vector | FormatDataForDisplay (TreePopulation oPop) |
Formats data for display in a set of JTables. | |
void | WriteXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException |
Writes the XML data to a parameter file for the behaviors owned by this object. | |
boolean | IsThisDataUsed (ModelData oData) |
Whether this piece of data is used and should be written to an XML file. | |
void | SetVectorValues (ModelVector oData, Float[] p_fValuesToSet, boolean[] p_bAppliesTo) |
Sets the values for vector variables. | |
void | SetVectorValues (ModelVector oData, Float[] p_fValuesToSet) |
Sets the values for vector variables. | |
void | SetVectorValues (ModelVector oData, Integer[] p_iValuesToSet, boolean[] p_bAppliesTo) |
Sets the values for vector variables. | |
void | SetVectorValues (ModelVector oData, String[] p_sValuesToSet) |
Sets the values for vector variables. | |
void | SetVectorValues (ModelVector oData, String[] p_sValuesToSet, boolean[] p_bAppliesTo) |
Sets the values for vector variables. | |
void | SetVectorValues (ModelVector oData, Integer[] p_iValuesToSet) |
Sets the values for vector variables. | |
void | SetVectorValues (ModelVector p_oData, Vector p_oValuesToSet, boolean[] p_bAppliesTo) throws ModelException |
Sets the values for vector variables. | |
void | MakeSureAllPositive (ModelVector oData, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of a vector are positive numbers (greater than zero). | |
void | MakeSureAllPositive (ModelVector oData) throws ModelException |
Makes sure the elements of a vector are positive numbers (greater than zero). | |
void | MakeSureAllNonNegative (ModelVector oData, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of a vector are non-negative numbers (greater than or equal to zero). | |
void | MakeSureAllNonNegative (ModelVector oData) throws ModelException |
Makes sure the elements of a vector are non-negative numbers (greater than or equal to zero). | |
void | MakeSureAllNonZero (ModelVector oData) throws ModelException |
Makes sure the elements of a vector are non-zero. | |
void | MakeSureAllNonZero (ModelVector oData, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of a vector are non-zero numbers. | |
void | MakeSureAllAreBounded (ModelVector oData, boolean[] p_bAppliesTo, float fLowerBound, float fUpperBound) throws ModelException |
Makes sure that all the values in a vector fall between two bounds. | |
void | MakeSureAllPositive (Float[] p_fData, String sName, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of a float array are positive numbers (greater than zero). | |
void | MakeSureAllPositive (Float[] p_fData, String sName) throws ModelException |
Makes sure the elements of a float array are positive numbers (greater than zero). | |
void | MakeSureAllNonNegative (Float[] p_fData, String sName, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of a float array are non-negative numbers (greater than or equal to zero). | |
void | MakeSureAllNonNegative (Float[] p_fData, String sName) throws ModelException |
Makes sure the elements of a float array are non-negative numbers (greater than or equal to zero). | |
void | MakeSureAllPositive (Integer[] p_iData, String sName, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of an integer array are positive numbers (greater than zero). | |
void | MakeSureAllPositive (Integer[] p_iData, String sName) throws ModelException |
Makes sure the elements of an integer array are positive numbers (greater than zero). | |
void | MakeSureAllNonNegative (Integer[] p_iData, String sName, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the elements of an integer array are non-negative numbers (greater than or equal to zero). | |
void | MakeSureAllNonNegative (Integer[] p_iData, String sName) throws ModelException |
Makes sure the elements of an integer array are non-negative numbers (greater than or equal to zero). | |
void | MakeSurePositive (ModelFloat oValue) throws ModelException |
Makes sure a value is greater than zero. | |
void | MakeSureNonNegative (ModelFloat oValue) throws ModelException |
Makes sure a value is greater than or equal to zero. | |
void | MakeSureIsBounded (ModelFloat oValue, float fLowerBound, float fUpperBound) throws ModelException |
Makes sure a value falls in an acceptable range. | |
void | MakeSureIsBounded (ModelInt oValue, float fLowerBound, float fUpperBound) throws ModelException |
Makes sure a value falls in an acceptable range. | |
void | MakeSureNonZero (ModelFloat oValue) throws ModelException |
Makes sure a value is not equal to zero. | |
void | MakeSureNonZero (ModelInt oValue) throws ModelException |
Makes sure a value is not equal to zero. | |
void | MakeSurePositive (ModelInt oValue) throws ModelException |
Makes sure a value is greater than zero. | |
void | MakeSureNonNegative (ModelInt oValue) throws ModelException |
Makes sure a value is greater than or equal to zero. | |
void | MakeSureIsProportion (ModelFloat fValue) throws ModelException |
Makes sure a value is a proportion between 0 and 1 (inclusive). | |
void | MakeSureAllAreProportions (ModelVector oData, boolean[] p_bAppliesTo) throws ModelException |
Makes sure the data in a vector are proportions between 0 and 1 (inclusive). | |
void | MakeSureAllAreProportions (ModelVector oData) throws ModelException |
Makes sure all the data in a vector are proportions between 0 and 1 (inclusive). | |
void | MakeSureRightSize (ModelVector oData, int iLength) throws ModelException |
Makes sure that a vector is of a certain size. | |
void | WriteSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop) throws java.io.IOException, ModelException |
Writes a set of species-specific float values to a parameter file. | |
void | WriteSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop, boolean[] p_bFlags) throws java.io.IOException, ModelException |
Writes a set of species-specific values to a parameter file for a certain subset of species. | |
void | ReadDataFromDisplay (Vector p_oData, TreePopulation oPop) throws ModelException |
Reads in data from the parameter display window. | |
abstract void | ValidateData (TreePopulation oPop) throws ModelException |
Override this to implement data checking. | |
ModelData | FindObjectByXMLTag (String sXMLTag) |
Finds an object based on its XML tag. | |
ModelData | FindObjectByDescriptor (String sDescriptor) |
Finds an object based on its descriptor. | |
boolean | SetSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException |
Sets a data object's value. | |
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. | |
void | ChangeOfSpecies (int iOldNumSpecies, int[] p_iIndexer) throws ModelException |
Triggered when there is a change in the species list. | |
void | ChangeOfSpeciesName (String sOldSpecies, String sNewSpecies) throws ModelException |
Performs any necessary tasks associated with changing the name of a species. | |
Static Public Member Functions | |
static void | WriteVectorValueToFile (BufferedWriter jOut, ModelVector p_oData) throws java.io.IOException |
Writes a vector of values that doesn't have anything to do with species. | |
static void | WriteDataToFile (BufferedWriter ojOut, ModelData oData) throws java.io. IOException |
Writes a piece of data to an XML file. | |
static Vector | MakeTableVector (Object[] p_oHeader, Object[][] p_oData) |
Wraps up a header row and table data into a vector. | |
Protected Member Functions | |
Object[][] | FormatDataForTable (Object[][] p_oExisting, ModelFloat oToFormat) |
Formats and adds a value into an Object array suitable for placing in a JTable. | |
Object[][] | FormatDataForTable (Object[][] p_oExisting, ModelInt oToFormat) |
Formats and adds a value into an Object array suitable for placing in a JTable. | |
Object[][] | FormatDataForTable (Object[][] p_oExisting, ModelString oToFormat) |
Formats and adds a value into an Object array suitable for placing in a JTable. | |
Object[][] | FormatDataForTable (Object[][] p_oExisting, ModelVector oToFormat) |
Formats a vector of values into an object array and adds it to another Object array suitable for placing in a JTable. | |
Object[][] | FormatDataForTable (Object[][] p_oExisting, ModelVector oToFormat, boolean[] p_bWhichSpecies) |
Formats a vector of values into a plain vector suitable for placing in a JTable and adds it to a vector of vectors at the end. | |
Object[][] | AddDataToArray (Object[][] p_oExistingArray, Object[] p_oAddArray) |
Adds an Object array to an existing Object array. | |
Object[] | FormatSpeciesHeaderRow (boolean[] p_bUsed, TreePopulation oPop) |
Creates an object array of strings consisting of species names, suitable for including in the parameter entry table. | |
Object[] | FormatBlankHeaderRow (Object[][] p_oTable) |
Creates a blank header row for a table. | |
Object[][] | FormatDataAsComboBox (Object[][] p_oExisting, ModelEnum oToFormat) |
Adds a value with combo box formatting to an Object array for display in a JTable. | |
String | FormatComboBoxString (ModelEnum oToFormat) |
Formats a combo box string from a ModelEnum. | |
void | AddDataObjectToDisplayArrays (ModelData p_oDataObject, Vector p_oSingles, Vector p_oSpeciesSpecific, boolean[] p_bAppliesTo) |
Adds a data object to the arrays which will eventually display run parameters in a set of tables. | |
boolean[] | MergeBooleans (boolean[] p_oMergeOne, boolean[] p_oMergeTwo) |
Merges two boolean arrays and returns an array where there is a true in each array bucket where EITHER array is true. | |
boolean | BoolArraysEqual (boolean[] p_bArrayOne, boolean[] p_bArrayTwo) |
Tests two boolean arrays for equality. | |
Vector | FormatTable (Vector p_oSingles, Vector p_oSpeciesSpecific, TreePopulation oPop) |
Turns vector groups of data objects into a set of tables for display. | |
void | SetSingleValue (ModelData oDataMember, Object oData) throws ModelException |
Sets the value of a single data member. | |
Protected Attributes | |
GUIManager | m_oManager |
GUIManager object. | |
String | m_sName |
User-consumable name for this object. | |
String | m_sXMLTag |
Highest-level XML tag for this object. | |
String | m_sHelpID = "" |
ID of help topic. | |
Vector | mp_oAllData |
All data for this object. | |
boolean | m_bAutoDisplayParameters |
Whether or not to auto-display this object's parameters. | |
Package Functions | |
WorkerBase (GUIManager oManager, String sName, String sXMLTag) | |
Constructor. |
Copyright: Copyright (c) Charles D. Canham 2003
Company: Institute of Ecosystem Studies
javawrapper::WorkerBase::WorkerBase | ( | GUIManager | oManager, | |
String | sName, | |||
String | sXMLTag | |||
) | [inline, package] |
Constructor.
oManager | GUIManager object | |
sName | User-consumable name for this object. | |
sXMLTag | Parent XML tag for all of this object's data |
void javawrapper::WorkerBase::AddDataObjectToDisplayArrays | ( | ModelData | p_oDataObject, | |
Vector | p_oSingles, | |||
Vector | p_oSpeciesSpecific, | |||
boolean[] | p_bAppliesTo | |||
) | [inline, protected] |
Adds a data object to the arrays which will eventually display run parameters in a set of tables.
There are two possible vectors to which to add the data object - one grouping single values, and other grouping groups of species-specific values according to the species they require.
When a new data object is to be added to the list, the first thing to do is see if it's already there. If it is, and it's not species-specific, it's not added again. If it is species-specific, the species to which it applies are merged with the existing list and it is re-grouped if necessary.
p_oDataObject | Data object to add | |
p_oSingles | Set of single values | |
p_oSpeciesSpecific | Set of species-specific values | |
p_bAppliesTo | If this is a species-specific value, what it applies to |
Object [][] javawrapper::WorkerBase::AddDataToArray | ( | Object | p_oExistingArray[][], | |
Object[] | p_oAddArray | |||
) | [inline, protected] |
Adds an Object array to an existing Object array.
The new array is added at the end. If the existing array is null, it will be created.
p_oExistingArray | Object array to add to. | |
p_oAddArray | Array to add. |
boolean javawrapper::WorkerBase::BoolArraysEqual | ( | boolean[] | p_bArrayOne, | |
boolean[] | p_bArrayTwo | |||
) | [inline, protected] |
Tests two boolean arrays for equality.
Equality is defined as having the same value in each array bucket.
p_bArrayOne | First array. | |
p_bArrayTwo | Second array. |
void javawrapper::WorkerBase::ChangeOfSpecies | ( | int | iOldNumSpecies, | |
int[] | p_iIndexer | |||
) | throws ModelException [inline] |
Triggered when there is a change in the species list.
This goes through everything in the mp_oAllData array. Any piece of data of type ModelVector which has a size matching the old number of species is assumed to be species-specific and in need of transformation. The ModelVector will be re-sized to match the new number of species. Any species that are the same from the old set to the new have their data transferred to their new array index. Any new species indexes are set to null. Any species which were deleted have their data lost.
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 there's a problem. |
Reimplemented in javawrapper::DisturbanceBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, and javawrapper::TreePopulation.
void javawrapper::WorkerBase::ChangeOfSpeciesName | ( | String | sOldSpecies, | |
String | sNewSpecies | |||
) | throws ModelException [inline] |
Performs any necessary tasks associated with changing the name of a species.
Everything about the species remains the same except for the name. This is an easier process than actually changing the species list.
sOldSpecies | String Old name of the species, with underscores instead of spaces (like the species names would come from the tree population) | |
sNewSpecies | String New name of the species, with underscores instead of spaces (like the species names would come from the tree population) |
ModelException | if there is a problem. |
Reimplemented in javawrapper::GrowthBehaviors, and javawrapper::MortalityBehaviors.
abstract void javawrapper::WorkerBase::DoSetup | ( | TreePopulation | oPop | ) | throws ModelException [pure virtual] |
Does any needed setup once the tree population object has data.
This will be called once the tree population has its data.
oPop | TreePopulation object. |
ModelException | if there are problems with setup. |
Implemented in javawrapper::Allometry, javawrapper::AnalysisBehaviors, javawrapper::DisperseBehaviors, javawrapper::DisturbanceBehaviors, javawrapper::EstablishmentBehaviors, javawrapper::GrowthBehaviors, javawrapper::LightBehaviors, javawrapper::MortalityBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, javawrapper::Plot, javawrapper::RemoveDeadBehaviors, javawrapper::SeedPredationBehaviors, javawrapper::SubstrateBehaviors, javawrapper::TreePopulation, and javawrapper::WorkerTester.
ModelData javawrapper::WorkerBase::FindObjectByDescriptor | ( | String | sDescriptor | ) | [inline] |
Finds an object based on its descriptor.
sDescriptor | Descriptor for the object. |
ModelData javawrapper::WorkerBase::FindObjectByXMLTag | ( | String | sXMLTag | ) | [inline] |
Finds an object based on its XML tag.
sXMLTag | XML tag for the object. |
Object [] javawrapper::WorkerBase::FormatBlankHeaderRow | ( | Object | p_oTable[][] | ) | [inline, protected] |
Creates a blank header row for a table.
It will be sized the same size as the size of the array in the first array position.
p_oTable | The table for which to create the blank header row. |
String javawrapper::WorkerBase::FormatComboBoxString | ( | ModelEnum | oToFormat | ) | [inline, protected] |
Formats a combo box string from a ModelEnum.
The formatting consists of some special characters in a text string that our parameter display code will recognize as setup for a combo box.
oToFormat | ModelEnum to format. |
Object [][] javawrapper::WorkerBase::FormatDataAsComboBox | ( | Object | p_oExisting[][], | |
ModelEnum | oToFormat | |||
) | [inline, protected] |
Adds a value with combo box formatting to an Object array for display in a JTable.
The formatting consists of some special characters in a text string that our parameter display code will recognize as setup for a combo box.
p_oExisting | Object array to add to. | |
oToFormat | Value to add. |
Vector javawrapper::WorkerBase::FormatDataForDisplay | ( | TreePopulation | oPop | ) | [inline] |
Formats data for display in a set of JTables.
For all required behaviors, their required data objects are placed in a table. Each element in the vector returned is one table to display, stored in a vector. Each single table vector's first element is an Object array with the header row for the table, and the second element is an Object[][] with the table's data. Data labels should be placed in the first array bucket.
This function operates by looking at each behavior. For each behavior which is enabled, its required data objects are added to a data vector. The vector is a vector of vectors where the data objects are grouped together by number of columns they require.
Once the sorted lists are in place, they are transformed to the table format and returned.
oPop | TreePopulation object. |
Reimplemented in javawrapper::OutputBehaviors, and javawrapper::PlantingBehaviors.
Object [][] javawrapper::WorkerBase::FormatDataForTable | ( | Object | p_oExisting[][], | |
ModelVector | oToFormat, | |||
boolean[] | p_bWhichSpecies | |||
) | [inline, protected] |
Formats a vector of values into a plain vector suitable for placing in a JTable and adds it to a vector of vectors at the end.
No headers are created. The descriptor is placed in the first bucket of the new vector and all subsequent values in order after that.
p_oExisting | The existing Object array to add to. | |
oToFormat | The object to format. | |
p_bWhichSpecies | Boolean of whether or not each species should be added. If false for a species, the value at that Vector index is not added. |
Object [][] javawrapper::WorkerBase::FormatDataForTable | ( | Object | p_oExisting[][], | |
ModelVector | oToFormat | |||
) | [inline, protected] |
Formats a vector of values into an object array and adds it to another Object array suitable for placing in a JTable.
The descriptor is placed in the first bucket of the new vector and all subsequent values in order after that.
p_oExisting | The existing Object array to add to. | |
oToFormat | The object to format. |
Object [][] javawrapper::WorkerBase::FormatDataForTable | ( | Object | p_oExisting[][], | |
ModelString | oToFormat | |||
) | [inline, protected] |
Formats and adds a value into an Object array suitable for placing in a JTable.
The new array is formed by taking the descriptor and putting it into the first position, and then putting the value in the next position.
p_oExisting | The existing Object array to add to. | |
oToFormat | The object to format. |
Object [][] javawrapper::WorkerBase::FormatDataForTable | ( | Object | p_oExisting[][], | |
ModelInt | oToFormat | |||
) | [inline, protected] |
Formats and adds a value into an Object array suitable for placing in a JTable.
The new array is formed by taking the descriptor and putting it into the first position, and then putting the value in the next position.
p_oExisting | The existing Object array to add to. | |
oToFormat | The object to format. |
Object [][] javawrapper::WorkerBase::FormatDataForTable | ( | Object | p_oExisting[][], | |
ModelFloat | oToFormat | |||
) | [inline, protected] |
Formats and adds a value into an Object array suitable for placing in a JTable.
The new array is formed by taking the descriptor and putting it into the first position, and then putting the value in the next position.
p_oExisting | The existing Object array to add to. | |
oToFormat | The object to format. |
Object [] javawrapper::WorkerBase::FormatSpeciesHeaderRow | ( | boolean[] | p_bUsed, | |
TreePopulation | oPop | |||
) | [inline, protected] |
Creates an object array of strings consisting of species names, suitable for including in the parameter entry table.
The species will be in order, skipping over any positions in p_bUsed which are false. The first position in the array is blank.
p_bUsed | Array of which species to include, in species number order. | |
oPop | TreePopulation object. |
Vector javawrapper::WorkerBase::FormatTable | ( | Vector | p_oSingles, | |
Vector | p_oSpeciesSpecific, | |||
TreePopulation | oPop | |||
) | [inline, protected] |
Turns vector groups of data objects into a set of tables for display.
p_oSingles | Single values. | |
p_oSpeciesSpecific | Vector of vectors of species-specific values grouped together by what species they apply to. | |
oPop | TreePopulation object. |
boolean javawrapper::WorkerBase::GetAutoDisplayParameters | ( | ) | [inline] |
Gets whether to auto-display this object's parameters.
String javawrapper::WorkerBase::GetHelpID | ( | ) | [inline] |
Gets this object's help ID, if it exists.
String javawrapper::WorkerBase::GetName | ( | ) | [inline] |
Returns the user-acceptable name for this object.
boolean javawrapper::WorkerBase::IsThisDataUsed | ( | ModelData | oData | ) | [inline] |
Whether this piece of data is used and should be written to an XML file.
Override this if all data is not to be used.
oData | Data to check. |
Reimplemented in javawrapper::BehaviorTypeBase.
void javawrapper::WorkerBase::MakeSureAllAreBounded | ( | ModelVector | oData, | |
boolean[] | p_bAppliesTo, | |||
float | fLowerBound, | |||
float | fUpperBound | |||
) | throws ModelException [inline] |
Makes sure that all the values in a vector fall between two bounds.
Only those indexes for which p_bAppliesTo = true at the same index are checked.
oData | ModelVector Vector to check. | |
p_bAppliesTo | boolean[] Set of flags for which values to check. | |
fLowerBound | float Minimum acceptable value. | |
fUpperBound | float Maximum acceptable value. |
ModelException | If any value falls outside of the range. |
void javawrapper::WorkerBase::MakeSureAllAreProportions | ( | ModelVector | oData | ) | throws ModelException [inline] |
Makes sure all the data in a vector are proportions between 0 and 1 (inclusive).
oData | Vector to check |
ModelException | if any value in the vector is not a valid proportion. |
void javawrapper::WorkerBase::MakeSureAllAreProportions | ( | ModelVector | oData, | |
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the data in a vector are proportions between 0 and 1 (inclusive).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
oData | Vector to check | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if any value in the vector is not a valid proportion. |
void javawrapper::WorkerBase::MakeSureAllNonNegative | ( | Integer[] | p_iData, | |
String | sName | |||
) | throws ModelException [inline] |
Makes sure the elements of an integer array are non-negative numbers (greater than or equal to zero).
p_iData | The array to check. | |
sName | The name of the vector, to put in the error message. |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonNegative | ( | Integer[] | p_iData, | |
String | sName, | |||
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of an integer array are non-negative numbers (greater than or equal to zero).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
p_iData | The array to check. | |
sName | The name of the vector, to put in the error message. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonNegative | ( | Float[] | p_fData, | |
String | sName | |||
) | throws ModelException [inline] |
Makes sure the elements of a float array are non-negative numbers (greater than or equal to zero).
p_fData | The array to check. | |
sName | The name of the vector, to put in the error message. |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonNegative | ( | Float[] | p_fData, | |
String | sName, | |||
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of a float array are non-negative numbers (greater than or equal to zero).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
p_fData | The array to check. | |
sName | The name of the vector, to put in the error message. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonNegative | ( | ModelVector | oData | ) | throws ModelException [inline] |
Makes sure the elements of a vector are non-negative numbers (greater than or equal to zero).
oData | The vector to check. |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonNegative | ( | ModelVector | oData, | |
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of a vector are non-negative numbers (greater than or equal to zero).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
oData | The vector to check. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonZero | ( | ModelVector | oData, | |
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of a vector are non-zero numbers.
Only those indexes for which p_bAppliesTo = true at the same index are checked.
oData | The vector to check. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any negative number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllNonZero | ( | ModelVector | oData | ) | throws ModelException [inline] |
Makes sure the elements of a vector are non-zero.
oData | The vector to check. |
ModelException | if there are any 0 values in the vector. |
void javawrapper::WorkerBase::MakeSureAllPositive | ( | Integer[] | p_iData, | |
String | sName | |||
) | throws ModelException [inline] |
Makes sure the elements of an integer array are positive numbers (greater than zero).
p_iData | The array to check. | |
sName | The name of the vector, to put in the error message. |
ModelException | if there are any non-positive number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllPositive | ( | Integer[] | p_iData, | |
String | sName, | |||
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of an integer array are positive numbers (greater than zero).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
p_iData | The array to check. | |
sName | The name of the vector, to put in the error message. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any non-positive number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllPositive | ( | Float[] | p_fData, | |
String | sName | |||
) | throws ModelException [inline] |
Makes sure the elements of a float array are positive numbers (greater than zero).
p_fData | The array to check. | |
sName | The name of the vector, to put in the error message. |
ModelException | if there are any non-positive number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllPositive | ( | Float[] | p_fData, | |
String | sName, | |||
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of a float array are positive numbers (greater than zero).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
p_fData | The array to check. | |
sName | The name of the vector, to put in the error message. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any non-positive number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllPositive | ( | ModelVector | oData | ) | throws ModelException [inline] |
Makes sure the elements of a vector are positive numbers (greater than zero).
oData | The vector to check. |
ModelException | if there are any non-positive number values in the vector. |
void javawrapper::WorkerBase::MakeSureAllPositive | ( | ModelVector | oData, | |
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Makes sure the elements of a vector are positive numbers (greater than zero).
Only those indexes for which p_bAppliesTo = true at the same index are checked.
oData | The vector to check. | |
p_bAppliesTo | Set of flags for which values to check |
ModelException | if there are any non-positive number values in the vector. |
void javawrapper::WorkerBase::MakeSureIsBounded | ( | ModelInt | oValue, | |
float | fLowerBound, | |||
float | fUpperBound | |||
) | throws ModelException [inline] |
Makes sure a value falls in an acceptable range.
oValue | The value to check. | |
fLowerBound | float Minimum acceptable value. | |
fUpperBound | float Maximum acceptable value. |
ModelException | If any value falls outside of the range. Edit history: ------------------ July 21, 2006: Created (LEM) |
void javawrapper::WorkerBase::MakeSureIsBounded | ( | ModelFloat | oValue, | |
float | fLowerBound, | |||
float | fUpperBound | |||
) | throws ModelException [inline] |
Makes sure a value falls in an acceptable range.
oValue | The value to check. | |
fLowerBound | float Minimum acceptable value. | |
fUpperBound | float Maximum acceptable value. |
ModelException | If any value falls outside of the range. Edit history: ------------------ July 21, 2006: Created (LEM) |
void javawrapper::WorkerBase::MakeSureIsProportion | ( | ModelFloat | fValue | ) | throws ModelException [inline] |
Makes sure a value is a proportion between 0 and 1 (inclusive).
fValue | Value to check. |
ModelException | if the value is not a valid proportion. |
void javawrapper::WorkerBase::MakeSureNonNegative | ( | ModelInt | oValue | ) | throws ModelException [inline] |
Makes sure a value is greater than or equal to zero.
oValue | The value to check. |
ModelException | if the value is not greater than zero. |
void javawrapper::WorkerBase::MakeSureNonNegative | ( | ModelFloat | oValue | ) | throws ModelException [inline] |
Makes sure a value is greater than or equal to zero.
oValue | The value to check. |
ModelException | if the value is not greater than zero. |
void javawrapper::WorkerBase::MakeSureNonZero | ( | ModelInt | oValue | ) | throws ModelException [inline] |
Makes sure a value is not equal to zero.
oValue | The value to check. |
ModelException | if the value is equal to zero. |
void javawrapper::WorkerBase::MakeSureNonZero | ( | ModelFloat | oValue | ) | throws ModelException [inline] |
Makes sure a value is not equal to zero.
oValue | The value to check. |
ModelException | if the value is equal to zero (or in this case a very small number). |
void javawrapper::WorkerBase::MakeSurePositive | ( | ModelInt | oValue | ) | throws ModelException [inline] |
Makes sure a value is greater than zero.
oValue | The value to check. |
ModelException | if the value is not greater than zero. |
void javawrapper::WorkerBase::MakeSurePositive | ( | ModelFloat | oValue | ) | throws ModelException [inline] |
Makes sure a value is greater than zero.
oValue | The value to check. |
ModelException | if the value is not greater than zero. |
void javawrapper::WorkerBase::MakeSureRightSize | ( | ModelVector | oData, | |
int | iLength | |||
) | throws ModelException [inline] |
Makes sure that a vector is of a certain size.
oData | Vector to validate. | |
iLength | Expected length. |
ModelException | if the vector is not of the correct length. |
static Vector javawrapper::WorkerBase::MakeTableVector | ( | Object[] | p_oHeader, | |
Object | p_oData[][] | |||
) | [inline, static] |
Wraps up a header row and table data into a vector.
p_oHeader | Header row. | |
p_oData | Table data. |
boolean [] javawrapper::WorkerBase::MergeBooleans | ( | boolean[] | p_oMergeOne, | |
boolean[] | p_oMergeTwo | |||
) | [inline, protected] |
Merges two boolean arrays and returns an array where there is a true in each array bucket where EITHER array is true.
If either array is null, the other array is returned. This will not make sure the arrays are the same length.
p_oMergeOne | First array to merge. | |
p_oMergeTwo | Second array to merge. |
void javawrapper::WorkerBase::ReadDataFromDisplay | ( | Vector | p_oData, | |
TreePopulation | oPop | |||
) | throws ModelException [inline] |
Reads in data from the parameter display window.
The format of the incoming data is the same as that which originally went jOut to be displayed in a table - a vector of vectors, with each child vector representing one table with an Object[] array header as the first element and an Object[][] array of data as the second.
p_oData | Data to read in. | |
oPop | TreePopulation object. |
ModelException | if the data cannot be read into the object. |
void javawrapper::WorkerBase::ReadXMLParentTag | ( | String | sXMLTag, | |
Attributes | oAttributes | |||
) | throws ModelException [inline] |
Accepts an XML parent tag (empty, no data) from the parser.
Normally this data would be ignored, but this can be overridden if there is special XML to be captured.
sXMLTag | The XML tag. | |
oAttributes | The attributes of this object. |
ModelException | if there is a problem reading this data. |
Reimplemented in javawrapper::DisturbanceBehaviors, javawrapper::LightBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, and javawrapper::TreePopulation.
void javawrapper::WorkerBase::SetSingleValue | ( | ModelData | oDataMember, | |
Object | oData | |||
) | throws ModelException [inline, protected] |
Sets the value of a single data member.
The value to set is cast to the proper type.
oDataMember | Data member to set. | |
oData | Data value to set into data member. |
ModelException | if data is of the wrong type. |
Reimplemented in javawrapper::SubstrateBehaviors.
boolean javawrapper::WorkerBase::SetSingleValueByXMLTag | ( | String | sXMLTag, | |
String | sXMLParentTag, | |||
Attributes | oAttributes, | |||
Object | oData | |||
) | throws ModelException [inline] |
Sets a data object's value.
Override this to add functionality.
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, either a String or a type appropriate to the data type |
ModelException | if the value could not be assigned to the data object. |
Reimplemented in javawrapper::DisturbanceBehaviors, javawrapper::LightBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, and javawrapper::TreePopulation.
boolean javawrapper::WorkerBase::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.
Override this to add functionality.
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 in javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, and javawrapper::TreePopulation.
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | p_oData, | |
Vector | p_oValuesToSet, | |||
boolean[] | p_bAppliesTo | |||
) | throws ModelException [inline] |
Sets the values for vector variables.
The values in the vector which contains the values being assigned are cast to match the data types in the vector to which the values are being assigned. Only those vector indexes for which p_bApplies = true at that same index are set.
p_oData | Vector data variable to set. | |
p_oValuesToSet | Vector of values to put into the vector. | |
p_bAppliesTo | Array of flags for which values should be set. |
ModelException | if the values cannot be cast to the correct type and assigned. |
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | oData, | |
Integer[] | p_iValuesToSet | |||
) | [inline] |
Sets the values for vector variables.
This method replaces all values in the vector with the values passed, in the order in which they are in the array.
oData | Vector data variable to set. | |
p_iValuesToSet | Array of values to put into the vector. |
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | oData, | |
String[] | p_sValuesToSet, | |||
boolean[] | p_bAppliesTo | |||
) | [inline] |
Sets the values for vector variables.
This method replaces all values in the vector with the values passed, in the order in which they are in the array.
oData | Vector data variable to set. | |
p_sValuesToSet | Array of values to put into the vector. | |
p_bAppliesTo | Array of flags for which values should be set. |
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | oData, | |
String[] | p_sValuesToSet | |||
) | [inline] |
Sets the values for vector variables.
This method replaces values in the vector with the values passed, in the order in which they are in the array.
oData | Vector data variable to set. | |
p_sValuesToSet | Array of values to put into the vector. |
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | oData, | |
Integer[] | p_iValuesToSet, | |||
boolean[] | p_bAppliesTo | |||
) | [inline] |
Sets the values for vector variables.
This method replaces all values in the vector with the values passed, in the order in which they are in the array.
oData | Vector data variable to set. | |
p_iValuesToSet | Array of values to put into the vector. | |
p_bAppliesTo | Array of flags for which values should be set. |
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | oData, | |
Float[] | p_fValuesToSet | |||
) | [inline] |
Sets the values for vector variables.
This method replaces values in the vector with the values passed, in the order in which they are in the array.
oData | Vector data variable to set. | |
p_fValuesToSet | Array of values to put into the vector. |
void javawrapper::WorkerBase::SetVectorValues | ( | ModelVector | oData, | |
Float[] | p_fValuesToSet, | |||
boolean[] | p_bAppliesTo | |||
) | [inline] |
Sets the values for vector variables.
This method replaces values in the vector with the values passed, in the order in which they are in the array. Only those vector indexes for which p_bApplies = true at that same index are set.
oData | Vector data variable to set. | |
p_fValuesToSet | Array of values to put into the vector. | |
p_bAppliesTo | Array of flags for which values should be set. |
abstract void javawrapper::WorkerBase::ValidateData | ( | TreePopulation | oPop | ) | throws ModelException [pure virtual] |
Override this to implement data checking.
This will be called after data has been set.
oPop | TreePopulation object. |
ModelException | if data doesn't pass validation. |
Implemented in javawrapper::Allometry, javawrapper::AnalysisBehaviors, javawrapper::DisperseBehaviors, javawrapper::DisturbanceBehaviors, javawrapper::EstablishmentBehaviors, javawrapper::GrowthBehaviors, javawrapper::LightBehaviors, javawrapper::MortalityBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, javawrapper::Plot, javawrapper::RemoveDeadBehaviors, javawrapper::SeedPredationBehaviors, javawrapper::SubstrateBehaviors, javawrapper::TreePopulation, and javawrapper::WorkerTester.
static void javawrapper::WorkerBase::WriteDataToFile | ( | BufferedWriter | ojOut, | |
ModelData | oData | |||
) | throws java.io. IOException [inline, static] |
Writes a piece of data to an XML file.
If the string value is an empty string, nothing is written. This is static because I needed this particular method to be static. But it's a good idea for other methods as well - maybe I should move all of them to a separate static class? Or move this to ModelData?
ojOut | The file to write to. | |
oData | The data being written. |
java.io.IOException | Passes on exceptions from FileWriter |
void javawrapper::WorkerBase::WriteSpeciesSpecificValue | ( | BufferedWriter | jOut, | |
ModelVector | p_oData, | |||
TreePopulation | oPop, | |||
boolean[] | p_bFlags | |||
) | throws java.io.IOException, ModelException [inline] |
Writes a set of species-specific values to a parameter file for a certain subset of species.
If none of the species are enabled, nothing is written.
jOut | The file to write to. | |
p_oData | The vector of data pieces. It should be sized to equal the total number of species, even if it doesn't have values for them all. Each piece of data for a species should be at the element index corresponding to the species number. | |
oPop | Tree population object to get species names | |
p_bFlags | An array, sized total number of species; for each species number, whether or not to include data for the species in question. |
java.io.IOException | Passes on exceptions from FileWriter | |
ModelException | Passes on from TreePopulation |
void javawrapper::WorkerBase::WriteSpeciesSpecificValue | ( | BufferedWriter | jOut, | |
ModelVector | p_oData, | |||
TreePopulation | oPop | |||
) | throws java.io.IOException, ModelException [inline] |
Writes a set of species-specific float values to a parameter file.
jOut | The file to write to. | |
p_oData | The vector of data pieces. | |
oPop | Tree population object to get species names |
java.io.IOException | Passes on exceptions from FileWriter | |
ModelException | Passes on from TreePopulation |
Reimplemented in javawrapper::BehaviorTypeBase.
static void javawrapper::WorkerBase::WriteVectorValueToFile | ( | BufferedWriter | jOut, | |
ModelVector | p_oData | |||
) | throws java.io.IOException [inline, static] |
Writes a vector of values that doesn't have anything to do with species.
jOut | The file to write to. | |
p_oData | The vector of data pieces. |
java.io.IOException | Passes on exceptions from FileWriter |
void javawrapper::WorkerBase::WriteXML | ( | BufferedWriter | jOut, | |
TreePopulation | oPop | |||
) | throws ModelException [inline] |
Writes the XML data to a parameter file for the behaviors owned by this object.
jOut | File stream to write to. | |
oPop | TreePopulation object. |
ModelException | if there is a problem writing the file or validating the data. |
Reimplemented in javawrapper::BehaviorTypeBase, javawrapper::DisturbanceBehaviors, javawrapper::LightBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, and javawrapper::TreePopulation.
Vector javawrapper::WorkerBase::mp_oAllData [protected] |
All data for this object.
It should be placed in the order in which it should be written in XML.