javawrapper::Behavior Class Reference

Represents a single behavior in the core. More...

List of all members.

Public Member Functions

 Behavior (String sKey, String sDescriptor, String sParFileTag, float fVersion, float fMinVersion)
 Constructor.
 Behavior (String sKey, String sDescriptor, String sParFileTag, float 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.
float GetVersion ()
 Gets behavior's parameter file version.
float 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 (Object 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 mp_oTreesAppliesTo = new Vector(0)
 A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees.
Vector mp_oGridsAppliesTo = new Vector(0)
 A set of Grids to which this behavior is applied - or none if it is not applied to grids.
Vector mp_oRequiredData = new Vector(0)
 The data objects which are required when this behavior is enabled (i.e.
Vector mp_oNewTreeDataMembers = new Vector(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
 Dey 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.
float m_fVersion
 Version of this behavior.
float m_fMinVersion = (float) 1.0
 Minimum version of this behavior.


Detailed Description

Represents a single behavior in the core.

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

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
April 30, 2004: Made version into a float (duh) (LEM)
July 20, 2004: Added new tree data members (LEM)


Constructor & Destructor Documentation

javawrapper::Behavior::Behavior String  sKey,
String  sDescriptor,
String  sParFileTag,
float  fVersion,
float  fMinVersion
[inline]
 

Constructor.

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

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
April 30, 2004: Updated version to be a float (LEM)

javawrapper::Behavior::Behavior String  sKey,
String  sDescriptor,
String  sParFileTag,
float  fVersion
[inline]
 

Constructor.

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

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
April 30, 2004: Updated version to be a float (LEM)


Member Function Documentation

void javawrapper::Behavior::AddGrid Grid  oGrid  )  [inline]
 

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.

Parameters:
oGrid Grid to add.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
July 21, 2004: Made it so a duplicate grid replaces an existing of the same name. This allows for grids to be updated. (LEM)

void javawrapper::Behavior::AddRequiredData Object  oData  )  [inline]
 

Adds a piece of required data to the list.

Parameters:
oData Data to add.

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

void javawrapper::Behavior::AddSpeciesTypeCombo SpeciesTypeCombo  oCombo  )  throws ModelException [inline]
 

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.

Parameters:
oCombo The new species/type combo.
Exceptions:
ModelException if the tree type in the combo cannot be applied to this behavior according to mp_bCanApplyToTreeType.

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

void javawrapper::Behavior::ClearSpeciesTypeCombos  )  [inline]
 

Empties the species/type combo list.

If this behavior has its m_bMustHaveTrees flag set to true, this sets m_bIsEnabled to false.


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

Object javawrapper::Behavior::clone  )  [inline]
 

Override to make a clone of this object.

Returns:
Deep clone of this object.

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

void javawrapper::Behavior::DeleteSpeciesTypeCombo int  iIndex  )  throws ModelException [inline]
 

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.

Parameters:
iIndex The index number of the SpeciesTypeCombo.
Exceptions:
ModelException if the index number is invalid.

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

String javawrapper::Behavior::GetDescriptor  )  [inline]
 

Gets the descriptor string.

Returns:
The descriptor string.

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

Grid javawrapper::Behavior::GetGrid int  iIndex  )  throws ModelException [inline]
 

Returns the Grid at the given index of the grid applies to list.

Parameters:
iIndex Index of grid desired.
Returns:
The Grid object requested.
Exceptions:
ModelException if the index is not valid.

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

String javawrapper::Behavior::GetKey  )  [inline]
 

Gets the key string.

Returns:
Key string.

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

float javawrapper::Behavior::GetMinimumVersion  )  [inline]
 

Gets behavior's parameter file minimum version.

Returns:
Parameter file minimum version.

Edit history:
------------------
April 30, 2004: Created (LEM)

int javawrapper::Behavior::GetNumberOfCombos  )  [inline]
 

Gets the number of species/type combos to which this behavior applies.

Returns:
the number of species/type combos.

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

int javawrapper::Behavior::GetNumberOfGrids  )  [inline]
 

Gets the number of grids to which this behavior applies.

Returns:
the number of grids.

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

int javawrapper::Behavior::GetNumberOfRequiredDataObjects  )  [inline]
 

Gets the number of required data objects for this behavior.

Returns:
Number of required data objects.

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

String javawrapper::Behavior::GetParameterFileBehaviorName  )  [inline]
 

Gets the parameter file name for this behavior.

Returns:
Parameter file name for this behavior.

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

Object javawrapper::Behavior::GetRequiredData int  iIndex  )  [inline]
 

Returns the required data object at a given index.

Parameters:
iIndex Index.
Returns:
Required data.

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

SpeciesTypeCombo javawrapper::Behavior::GetSpeciesTypeCombo int  iIndex  )  throws ModelException [inline]
 

Returns the SpeciesTypeCombo at the given index of the species/type combo list.

Parameters:
iIndex Index of combo desired.
Returns:
The SpeciesTypeCombo object requested.
Exceptions:
ModelException if the index is not valid.

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

float javawrapper::Behavior::GetVersion  )  [inline]
 

Gets behavior's parameter file version.

Returns:
Parameter file version.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
April 30, 2004: Made version into a float (LEM)

boolean [] javawrapper::Behavior::GetWhichSpeciesUsed TreePopulation  oPop  )  [inline]
 

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.

Parameters:
oPop Tree population.
Returns:
An array, sized total number of species, with a boolean for each species number as to whether or not this behavior applies to it.

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

void javawrapper::Behavior::SetCanApplyTo int  iType,
boolean  bCanApply
[inline]
 

Sets whether this behavior can apply to a given tree type.

Parameters:
iType Tree type.
bCanApply True if this can be applied to a tree type; false if not.

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

void javawrapper::Behavior::SetDescriptor String  s  )  [inline]
 

Sets the descriptor string.

Parameters:
s New descriptor string.

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

void javawrapper::Behavior::Validate  )  throws ModelException [inline]
 

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.

Exceptions:
ModelException if the above condition is true.

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


Member Data Documentation

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.

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

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.

Vector javawrapper::Behavior::mp_oNewTreeDataMembers = new Vector(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.

Vector javawrapper::Behavior::mp_oRequiredData = new Vector(0) [protected]
 

The data objects which are required when this behavior is enabled (i.e.

the individual pieces of data that must have values)


The documentation for this class was generated from the following file:
Generated on Mon Mar 27 15:15:30 2006 for SORTIE Java Interface by  doxygen 1.4.6-NO