Public Member Functions | |
Behavior (String sKey, String sDescriptor, String sParFileTag, double fVersion, double fMinVersion) | |
Constructor. | |
Behavior (String sKey, String sDescriptor, String sParFileTag, double fVersion) | |
Constructor. | |
void | Validate () throws ModelException |
Behavior performs an internal check to make sure its settings are consistent and logical. | |
void | SetCanApplyTo (int iType, boolean bCanApply) |
Sets whether this behavior can apply to a given tree type. | |
String | GetKey () |
Gets the key string. | |
String | GetParameterFileBehaviorName () |
Gets the parameter file name for this behavior. | |
double | GetVersion () |
Gets behavior's parameter file version. | |
double | GetMinimumVersion () |
Gets behavior's parameter file minimum version. | |
String | GetDescriptor () |
Gets the descriptor string. | |
void | SetDescriptor (String s) |
Sets the descriptor string. | |
int | GetNumberOfCombos () |
Gets the number of species/type combos to which this behavior applies. | |
int | GetNumberOfGrids () |
Gets the number of grids to which this behavior applies. | |
void | DeleteSpeciesTypeCombo (int iIndex) throws ModelException |
Deletes the SpeciesTypeCombo at the given index. | |
void | ClearSpeciesTypeCombos () |
Empties the species/type combo list. | |
SpeciesTypeCombo | GetSpeciesTypeCombo (int iIndex) throws ModelException |
Returns the SpeciesTypeCombo at the given index of the species/type combo list. | |
Grid | GetGrid (int iIndex) throws ModelException |
Returns the Grid at the given index of the grid applies to list. | |
Object | GetRequiredData (int iIndex) |
Returns the required data object at a given index. | |
int | GetNumberOfRequiredDataObjects () |
Gets the number of required data objects for this behavior. | |
void | AddSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException |
Adds a new species/type combo to the list to which this behavior applies. | |
void | AddGrid (Grid oGrid) |
Adds a new Grid to the list to which this behavior applies. | |
void | AddRequiredData (ModelData oData) |
Adds a piece of required data to the list. | |
boolean[] | GetWhichSpeciesUsed (TreePopulation oPop) |
Returns which species to which this behavior is applied. | |
Object | clone () |
Override to make a clone of this object. | |
Public Attributes | |
boolean | m_bMustHaveTrees = true |
If true, and a tree has no species/type combos, it automatically becomes disabled. | |
boolean | m_bIsEnabled = false |
Whether or not the current parameter file uses this behavior - and thus whether it will get called during the setup sequence. | |
boolean | m_bCanEditAutomatically = true |
Whether or not this behavior can be edited automatically (true) or must be edited with its own dialog (false). | |
Protected Attributes | |
Vector< SpeciesTypeCombo > | mp_oTreesAppliesTo = new Vector<SpeciesTypeCombo>(0) |
A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees. | |
Vector< Grid > | mp_oGridsAppliesTo = new Vector<Grid>(0) |
A set of strings with the name of Grids to which this behavior is applied - or none if it is not applied to grids. | |
Vector< ModelData > | mp_oRequiredData = new Vector<ModelData>(0) |
The data objects which are required when this behavior is enabled (i.e. | |
Vector< DataMember > | mp_oNewTreeDataMembers = new Vector<DataMember>(0) |
The new tree data members that this behavior adds, above and beyond the basic tree population data members. | |
String | m_sDescriptor |
This is what will be displayed as the name of a given behavior in the GUI. | |
String | m_sKey |
Key string - short unique identifier. | |
String | m_sParFileTag |
String which is used to identify this behavior in the parameter file. | |
boolean[] | mp_bCanApplyToTreeType |
For each tree type, whether or not this behavior can be applied to it. | |
double | m_fVersion |
Version of this behavior. | |
double | m_fMinVersion = 1.0 |
Minimum version of this behavior. |
There is a one-to-one relationship between behaviors in the core model and objects of this class. Unlike in the core model, however, this class is not meant to be extended and tailored.
Objects of this class act as placeholders for behaviors, keeping track of whether or not they are enabled and to whom they apply. They are "dumb", not performing any additional functions. They rely on their BehaviorTypeBase owners to keep track of their data.
Copyright: Copyright (c) 2003
Company: Institute of Ecosystem Studies
javawrapper.Behavior.Behavior | ( | String | sKey, | |
String | sDescriptor, | |||
String | sParFileTag, | |||
double | fVersion, | |||
double | fMinVersion | |||
) |
Constructor.
sKey | Key string - short unique identifier. | |
sDescriptor | Long description that will show up in GUI displays. | |
sParFileTag | Parameter file XML tag (no brackets). | |
fVersion | C++ object version number. | |
fMinVersion | C++ object minimum version number |
javawrapper.Behavior.Behavior | ( | String | sKey, | |
String | sDescriptor, | |||
String | sParFileTag, | |||
double | fVersion | |||
) |
Constructor.
sKey | Key string - short unique identifier. | |
sDescriptor | Long description that will show up in GUI displays. | |
sParFileTag | Parameter file XML tag (no brackets). | |
fVersion | C++ object version number. |
void javawrapper.Behavior.Validate | ( | ) | throws ModelException |
Behavior performs an internal check to make sure its settings are consistent and logical.
If m_bMustHaveTrees is set to true, it is enabled, and it has no trees, it throws an error.
ModelException | if the above condition is true. |
void javawrapper.Behavior.SetCanApplyTo | ( | int | iType, | |
boolean | bCanApply | |||
) |
Sets whether this behavior can apply to a given tree type.
iType | Tree type. | |
bCanApply | True if this can be applied to a tree type; false if not. |
String javawrapper.Behavior.GetKey | ( | ) |
Gets the key string.
String javawrapper.Behavior.GetParameterFileBehaviorName | ( | ) |
Gets the parameter file name for this behavior.
double javawrapper.Behavior.GetVersion | ( | ) |
Gets behavior's parameter file version.
double javawrapper.Behavior.GetMinimumVersion | ( | ) |
Gets behavior's parameter file minimum version.
String javawrapper.Behavior.GetDescriptor | ( | ) |
Gets the descriptor string.
void javawrapper.Behavior.SetDescriptor | ( | String | s | ) |
Sets the descriptor string.
s | New descriptor string. |
int javawrapper.Behavior.GetNumberOfCombos | ( | ) |
Gets the number of species/type combos to which this behavior applies.
int javawrapper.Behavior.GetNumberOfGrids | ( | ) |
Gets the number of grids to which this behavior applies.
void javawrapper.Behavior.DeleteSpeciesTypeCombo | ( | int | iIndex | ) | throws ModelException |
Deletes the SpeciesTypeCombo at the given index.
If this removes the last combo, and the behavior has its m_bMustHaveTrees flag set to true, this sets m_bIsEnabled to false.
iIndex | The index number of the SpeciesTypeCombo. |
ModelException | if the index number is invalid. |
void javawrapper.Behavior.ClearSpeciesTypeCombos | ( | ) |
Empties the species/type combo list.
If this behavior has its m_bMustHaveTrees flag set to true, this sets m_bIsEnabled to false.
SpeciesTypeCombo javawrapper.Behavior.GetSpeciesTypeCombo | ( | int | iIndex | ) | throws ModelException |
Returns the SpeciesTypeCombo at the given index of the species/type combo list.
iIndex | Index of combo desired. |
ModelException | if the index is not valid. |
Grid javawrapper.Behavior.GetGrid | ( | int | iIndex | ) | throws ModelException |
Returns the Grid at the given index of the grid applies to list.
iIndex | Index of grid desired. |
ModelException | if the index is not valid. |
Object javawrapper.Behavior.GetRequiredData | ( | int | iIndex | ) |
Returns the required data object at a given index.
iIndex | Index. |
int javawrapper.Behavior.GetNumberOfRequiredDataObjects | ( | ) |
Gets the number of required data objects for this behavior.
void javawrapper.Behavior.AddSpeciesTypeCombo | ( | SpeciesTypeCombo | oCombo | ) | throws ModelException |
Adds a new species/type combo to the list to which this behavior applies.
If this particular species/type combo is already on the list, it's not added again. Calling this causes this behavior to become enabled.
oCombo | The new species/type combo. |
ModelException | if the tree type in the combo cannot be applied to this behavior according to mp_bCanApplyToTreeType. |
void javawrapper.Behavior.AddGrid | ( | Grid | oGrid | ) |
Adds a new Grid to the list to which this behavior applies.
If this particular grid is already on the list, it's replaced. Calling this method does NOT automatically cause the behavior to become enabled, because grids are more of an inherent property of behaviors. For this reason, a Behavior should always be notified of its Grids whether or not it is enabled.
oGrid | Grid to add. |
void javawrapper.Behavior.AddRequiredData | ( | ModelData | oData | ) |
Adds a piece of required data to the list.
oData | Data to add. |
boolean [] javawrapper.Behavior.GetWhichSpeciesUsed | ( | TreePopulation | oPop | ) |
Returns which species to which this behavior is applied.
If multiple tree types are applied, a species is considered applied to if any, not all, of the types goes with that species.
oPop | Tree population. |
Object javawrapper.Behavior.clone | ( | ) |
Override to make a clone of this object.
Vector<SpeciesTypeCombo> javawrapper.Behavior.mp_oTreesAppliesTo = new Vector<SpeciesTypeCombo>(0) [protected] |
A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees.
Vector<Grid> javawrapper.Behavior.mp_oGridsAppliesTo = new Vector<Grid>(0) [protected] |
A set of strings with the name of Grids to which this behavior is applied - or none if it is not applied to grids.
Vector<ModelData> javawrapper.Behavior.mp_oRequiredData = new Vector<ModelData>(0) [protected] |
The data objects which are required when this behavior is enabled (i.e.
the individual pieces of data that must have values)
Vector<DataMember> javawrapper.Behavior.mp_oNewTreeDataMembers = new Vector<DataMember>(0) [protected] |
The new tree data members that this behavior adds, above and beyond the basic tree population data members.
This is a vector of DataMember objects.
boolean javawrapper.Behavior.m_bMustHaveTrees = true |
If true, and a tree has no species/type combos, it automatically becomes disabled.
Otherwise, it has to do with grids and enablement must be specifically set.
boolean javawrapper.Behavior.m_bIsEnabled = false |
Whether or not the current parameter file uses this behavior - and thus whether it will get called during the setup sequence.
boolean javawrapper.Behavior.m_bCanEditAutomatically = true |
Whether or not this behavior can be edited automatically (true) or must be edited with its own dialog (false).
String javawrapper.Behavior.m_sDescriptor [protected] |
This is what will be displayed as the name of a given behavior in the GUI.
Shouldn't be too long - max 5 words or so
String javawrapper.Behavior.m_sKey [protected] |
Key string - short unique identifier.
String javawrapper.Behavior.m_sParFileTag [protected] |
String which is used to identify this behavior in the parameter file.
boolean [] javawrapper.Behavior.mp_bCanApplyToTreeType [protected] |
For each tree type, whether or not this behavior can be applied to it.
This defaults to true for seedlings, saplings, adults, and snags, and false for all others.
double javawrapper.Behavior.m_fVersion [protected] |
Version of this behavior.
double javawrapper.Behavior.m_fMinVersion = 1.0 [protected] |
Minimum version of this behavior.