javawrapper::WorkerBase Class Reference

This class contains methods common to all objects that contain data. More...

Inheritance diagram for javawrapper::WorkerBase:

javawrapper::Allometry javawrapper::BehaviorTypeBase javawrapper::Plot javawrapper::TreePopulation javawrapper::WorkerTester javawrapper::AnalysisBehaviors javawrapper::DisperseBehaviors javawrapper::DisturbanceBehaviors javawrapper::EstablishmentBehaviors javawrapper::GrowthBehaviors javawrapper::LightBehaviors javawrapper::MortalityBehaviors javawrapper::OutputBehaviors javawrapper::PlantingBehaviors javawrapper::RemoveDeadBehaviors javawrapper::SeedPredationBehaviors javawrapper::SubstrateBehaviors List of all members.

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.

Detailed Description

This class contains methods common to all objects that contain data.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
July 19, 2004: Added help ID (LEM)


Constructor & Destructor Documentation

javawrapper::WorkerBase::WorkerBase ( GUIManager  oManager,
String  sName,
String  sXMLTag 
) [inline, package]

Constructor.

Parameters:
oManager GUIManager object
sName User-consumable name for this object.
sXMLTag Parent XML tag for all of this object's data

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Function Documentation

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.

Parameters:
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

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oExistingArray Object array to add to.
p_oAddArray Array to add.
Returns:
The new Object array.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_bArrayOne First array.
p_bArrayTwo Second array.
Returns:
true if the arrays are equal, false if they are not.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.
Exceptions:
ModelException if there's a problem.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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)
Exceptions:
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.

Parameters:
oPop TreePopulation object.
Exceptions:
ModelException if there are problems with setup.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
sDescriptor Descriptor for the object.
Returns:
ModelData object corresponding to the descriptor, or null if no such object is found.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

ModelData javawrapper::WorkerBase::FindObjectByXMLTag ( String  sXMLTag  )  [inline]

Finds an object based on its XML tag.

Parameters:
sXMLTag XML tag for the object.
Returns:
ModelData object corresponding to the XML tag, or null if no such object is found.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oTable The table for which to create the blank header row.
Returns:
The blank header row.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oToFormat ModelEnum to format.
Returns:
Formatted string.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oExisting Object array to add to.
oToFormat Value to add.
Returns:
Object array with new value added.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oPop TreePopulation object.
Returns:
Vector of vectors suitable for creating a set of JTables, or null if there is no data to display.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
October 7, 2004: Integrated the BehaviorTypeBase version of this back into here, and made it aware of the ModelVector "must apply to all species" member

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.

Parameters:
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.
Returns:
Object array suitable for placing in a JTable.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oExisting The existing Object array to add to.
oToFormat The object to format.
Returns:
Object array suitable for placing in a JTable.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oExisting The existing Object array to add to.
oToFormat The object to format.
Returns:
Object array suitable for placing in a JTable.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oExisting The existing Object array to add to.
oToFormat The object to format.
Returns:
Object array suitable for placing in a JTable.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oExisting The existing Object array to add to.
oToFormat The object to format.
Returns:
Object array suitable for placing in a JTable.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_bUsed Array of which species to include, in species number order.
oPop TreePopulation object.
Returns:
Object array of species names, or null if no species are to be used.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oSingles Single values.
p_oSpeciesSpecific Vector of vectors of species-specific values grouped together by what species they apply to.
oPop TreePopulation object.
Returns:
Vector of tables for display.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

boolean javawrapper::WorkerBase::GetAutoDisplayParameters (  )  [inline]

Gets whether to auto-display this object's parameters.

Returns:
Whether to auto-display parameters.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

String javawrapper::WorkerBase::GetHelpID (  )  [inline]

Gets this object's help ID, if it exists.

Returns:
The help ID, or "" if there is no help ID.

String javawrapper::WorkerBase::GetName (  )  [inline]

Returns the user-acceptable name for this object.

Returns:
Name.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData Data to check.
Returns:
Always true.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.
Exceptions:
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).

Parameters:
oData Vector to check
Exceptions:
ModelException if any value in the vector is not a valid proportion.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData Vector to check
p_bAppliesTo Set of flags for which values to check
Exceptions:
ModelException if any value in the vector is not a valid proportion.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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).

Parameters:
p_iData The array to check.
sName The name of the vector, to put in the error message.
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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).

Parameters:
p_fData The array to check.
sName The name of the vector, to put in the error message.
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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).

Parameters:
oData The vector to check.
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData The vector to check.
p_bAppliesTo Set of flags for which values to check
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData The vector to check.
p_bAppliesTo Set of flags for which values to check
Exceptions:
ModelException if there are any negative number values in the vector.

Edit history:
------------------
September 6, 2004: Created (LEM)

void javawrapper::WorkerBase::MakeSureAllNonZero ( ModelVector  oData  )  throws ModelException [inline]

Makes sure the elements of a vector are non-zero.

Parameters:
oData The vector to check.
Exceptions:
ModelException if there are any 0 values in the vector.

Edit history:
------------------
September 6, 2004: Created (LEM)

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).

Parameters:
p_iData The array to check.
sName The name of the vector, to put in the error message.
Exceptions:
ModelException if there are any non-positive number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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
Exceptions:
ModelException if there are any non-positive number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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).

Parameters:
p_fData The array to check.
sName The name of the vector, to put in the error message.
Exceptions:
ModelException if there are any non-positive number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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
Exceptions:
ModelException if there are any non-positive number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSureAllPositive ( ModelVector  oData  )  throws ModelException [inline]

Makes sure the elements of a vector are positive numbers (greater than zero).

Parameters:
oData The vector to check.
Exceptions:
ModelException if there are any non-positive number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData The vector to check.
p_bAppliesTo Set of flags for which values to check
Exceptions:
ModelException if there are any non-positive number values in the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSureIsBounded ( ModelInt  oValue,
float  fLowerBound,
float  fUpperBound 
) throws ModelException [inline]

Makes sure a value falls in an acceptable range.

Parameters:
oValue The value to check.
fLowerBound float Minimum acceptable value.
fUpperBound float Maximum acceptable value.
Exceptions:
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.

Parameters:
oValue The value to check.
fLowerBound float Minimum acceptable value.
fUpperBound float Maximum acceptable value.
Exceptions:
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).

Parameters:
fValue Value to check.
Exceptions:
ModelException if the value is not a valid proportion.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSureNonNegative ( ModelInt  oValue  )  throws ModelException [inline]

Makes sure a value is greater than or equal to zero.

Parameters:
oValue The value to check.
Exceptions:
ModelException if the value is not greater than zero.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSureNonNegative ( ModelFloat  oValue  )  throws ModelException [inline]

Makes sure a value is greater than or equal to zero.

Parameters:
oValue The value to check.
Exceptions:
ModelException if the value is not greater than zero.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSureNonZero ( ModelInt  oValue  )  throws ModelException [inline]

Makes sure a value is not equal to zero.

Parameters:
oValue The value to check.
Exceptions:
ModelException if the value is equal to zero.

Edit history:
------------------
December 8, 2005: Created (LEM)

void javawrapper::WorkerBase::MakeSureNonZero ( ModelFloat  oValue  )  throws ModelException [inline]

Makes sure a value is not equal to zero.

Parameters:
oValue The value to check.
Exceptions:
ModelException if the value is equal to zero (or in this case a very small number).

Edit history:
------------------
December 8, 2005: Created (LEM)

void javawrapper::WorkerBase::MakeSurePositive ( ModelInt  oValue  )  throws ModelException [inline]

Makes sure a value is greater than zero.

Parameters:
oValue The value to check.
Exceptions:
ModelException if the value is not greater than zero.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSurePositive ( ModelFloat  oValue  )  throws ModelException [inline]

Makes sure a value is greater than zero.

Parameters:
oValue The value to check.
Exceptions:
ModelException if the value is not greater than zero.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::WorkerBase::MakeSureRightSize ( ModelVector  oData,
int  iLength 
) throws ModelException [inline]

Makes sure that a vector is of a certain size.

Parameters:
oData Vector to validate.
iLength Expected length.
Exceptions:
ModelException if the vector is not of the correct length.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

static Vector javawrapper::WorkerBase::MakeTableVector ( Object[]  p_oHeader,
Object  p_oData[][] 
) [inline, static]

Wraps up a header row and table data into a vector.

Parameters:
p_oHeader Header row.
p_oData Table data.
Returns:
Table vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oMergeOne First array to merge.
p_oMergeTwo Second array to merge.
Returns:
Merged array.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
p_oData Data to read in.
oPop TreePopulation object.
Exceptions:
ModelException if the data cannot be read into the object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
sXMLTag The XML tag.
oAttributes The attributes of this object.
Exceptions:
ModelException if there is a problem reading this data.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oDataMember Data member to set.
oData Data value to set into data member.
Exceptions:
ModelException if data is of the wrong type.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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
Returns:
true if the value was set successfully; false if the value could not be found. (This would not be an error, because I need a way to cycle through the objects until one of the objects comes up with a match.)
Exceptions:
ModelException if the value could not be assigned to the data object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.
Returns:
true if the value was set successfully; false if the value could not be found. (This would not be an error, because I need a way to cycle through the objects until one of the objects comes up with a match.) If a match to a data object is made via XML tag, but the found object is not a ModelVector, this returns false.
Exceptions:
ModelException if the value could not be assigned to the data object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.
Exceptions:
ModelException if the values cannot be cast to the correct type and assigned.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData Vector data variable to set.
p_iValuesToSet Array of values to put into the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.
Todo:
Make this reject the setting of values for non-int vectors.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oData Vector data variable to set.
p_fValuesToSet Array of values to put into the vector.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oPop TreePopulation object.
Exceptions:
ModelException if data doesn't pass validation.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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?

Parameters:
ojOut The file to write to.
oData The data being written.
Exceptions:
java.io.IOException Passes on exceptions from FileWriter

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
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.
Exceptions:
java.io.IOException Passes on exceptions from FileWriter
ModelException Passes on from TreePopulation

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
October 7, 2004: Fixed this to work with the ModelVector "must apply to all species" attribute (LEM)

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.

Parameters:
jOut The file to write to.
p_oData The vector of data pieces.
oPop Tree population object to get species names
Exceptions:
java.io.IOException Passes on exceptions from FileWriter
ModelException Passes on from TreePopulation

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
jOut The file to write to.
p_oData The vector of data pieces.
Exceptions:
java.io.IOException Passes on exceptions from FileWriter

Edit history:
------------------
October 19, 2006: Created (LEM)

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.

Parameters:
jOut File stream to write to.
oPop TreePopulation object.
Exceptions:
ModelException if there is a problem writing the file or validating the data.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

Reimplemented in javawrapper::BehaviorTypeBase, javawrapper::DisturbanceBehaviors, javawrapper::LightBehaviors, javawrapper::OutputBehaviors, javawrapper::PlantingBehaviors, and javawrapper::TreePopulation.


Member Data Documentation

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.


The documentation for this class was generated from the following file:
Generated on Wed Nov 29 08:45:07 2006 for SORTIE Java Interface by  doxygen 1.4.7