javawrapper::OutputBehaviors Class Reference

Manages output behaviors and data. More...

Inheritance diagram for javawrapper::OutputBehaviors:

javawrapper::BehaviorTypeBase javawrapper::WorkerBase List of all members.

Public Member Functions

 OutputBehaviors (GUIManager oManager)
 Constructor.
Subplot AddSubplot (String sName)
 Creates a subplot.
void SetShortOutputFileName (String sFilename)
 Sets the short output filename.
String GetShortOutputFileName ()
 Gets the short output filename.
void SetDetailedOutputFileName (String sFilename)
 Sets the detailed output filename.
String GetDetailedOutputFileName ()
 Gets the detailed output filename.
int GetNumberOfDetailedTreeSettings ()
 Gets the number of tree settings for which there is detailed output info (each setting is one tree species/type combo).
int GetNumberOfDetailedGridSettings ()
 Gets the number of grid settings for which there is detailed output info.
boolean SavingShortOutputData ()
 Gets whether or not short output is being saved.
DetailedTreeSettings GetDetailedTreeSetting (int iIndex)
 Returns the detailed output tree setting at a specified index.
DetailedGridSettings GetDetailedGridSetting (int iIndex)
 Returns the detailed output grid setting at a specified index.
void SetSaveAbsoluteDensity (int iType, boolean bUse) throws ModelException
 Sets the save absolute density attribute for a type.
void SetSaveRelativeDensity (int iType, boolean bUse) throws ModelException
 Sets the save relative density attribute for a type.
void SetSaveAbsoluteBasalArea (int iType, boolean bUse) throws ModelException
 Sets the save absolute basal area attribute for a type.
void SetSaveRelativeBasalArea (int iType, boolean bUse) throws ModelException
 Sets the save relative basal area attribute for a type.
boolean GetSaveAbsoluteBasalArea (int iType) throws ModelException
 Gets whether or not absolute basal area is saved for a tree type.
boolean GetSaveRelativeBasalArea (int iType) throws ModelException
 Gets whether or not relative basal area is saved for a tree type.
boolean GetSaveAbsoluteDensity (int iType) throws ModelException
 Gets whether or not absolute density is saved for a tree type.
boolean GetSaveRelativeDensity (int iType) throws ModelException
 Gets whether or not relative density is saved for a tree type.
void WriteXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException
 Overridden from base because output parameters are special.
void ValidateData (TreePopulation oPop) throws ModelException
 Validates the data before writing to a parameter file.
void DoSetup (TreePopulation oPop) throws javawrapper.ModelException
 Performs setup.
Vector FormatDataForDisplay (TreePopulation oPop)
 This has its own display window; it won't contribute data to the display.
TreePopulation GetTreePopulation ()
 Gets the tree population.
void ClearDetailedTreeSettings ()
 Deletes all detailed output tree settings.
void ClearDetailedGridSettings ()
 Deletes all detailed output grid settings.
void AddDetailedTreeSettings (DetailedTreeSettings oTreeSettings) throws ModelException
 Adds a new detailed output tree settings object.
void AddDetailedGridSettings (DetailedGridSettings oTreeSettings)
 Adds a new detailed output grid settings object.
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)
 Checks detailed output settings upon change of species.

Static Public Attributes

static final String DETAILED_OUTPUT_EXTENSION = ".gz.tar"
static final String SUMMARY_EXTENSION = ".out"

Protected Member Functions

void UpdateIsEnabled (Behavior oBeh)
 Keeps the behavior enabled flag current.
void WriteShortOutputXML (BufferedWriter jOut) throws java.io. IOException
 Writes the parameter file data for short output.
void WriteDetailedOutputXML (BufferedWriter jOut, TreePopulation oPop) throws java.io. IOException, ModelException
 Writes the parameter file data for detailed output.

Protected Attributes

Vector mp_oShortTreeSaveSettings
 For short output - collection of TreeOutputSaveInfo objects - vector is sized number of types.
Vector mp_oDetailedTreeSaveSettings
 For detailed output - collection of DetailedTreeSettings objects.
Vector mp_oDetailedGridSaveSettings
 For detailed output - collection of DetailedGridSettings objects.
Vector mp_oSubplots
 For short output - the list of Subplot objects.
TreePopulation m_oPop
 Tree population.
ModelString m_sShortOutputFilename
 File name for short output.
ModelString m_sDetailedOutputFilename
 File name for detailed output.
DetailedOutputSettings m_oCurrentDetailedSettings
 When parsing an XML file, this is the setting currently receiving data.
Subplot m_oCurrentSubplot
 When parsing an XML file, this is the subplot currently receiving data.
int m_iCurrentType
 When parsing an XML file, this is the current short output type.

Package Functions

void DisplayWindow (MainWindow oWindow)
 Displays the output setup options.

Private Member Functions

boolean VerifyTreeMember (DataMember oDataMember, int iSpecies, int iType) throws ModelException

Detailed Description

Manages output behaviors and 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)


Constructor & Destructor Documentation

javawrapper::OutputBehaviors::OutputBehaviors GUIManager  oManager  )  [inline]
 

Constructor.

Parameters:
oManager GUIManager object.

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


Member Function Documentation

void javawrapper::OutputBehaviors::AddDetailedGridSettings DetailedGridSettings  oTreeSettings  )  [inline]
 

Adds a new detailed output grid settings object.

This will overwrite any existing settings for that grid.

Parameters:
oTreeSettings The new settings object.

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

void javawrapper::OutputBehaviors::AddDetailedTreeSettings DetailedTreeSettings  oTreeSettings  )  throws ModelException [inline]
 

Adds a new detailed output tree settings object.

This will overwrite any existing settings for that species and type.

Parameters:
oTreeSettings The new settings object.
Exceptions:
ModelException if either the type or the species name is invalid.

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

Subplot javawrapper::OutputBehaviors::AddSubplot String  sName  )  [inline]
 

Creates a subplot.

Parameters:
sName Name of the subplot.
Returns:
The new Subplot object.

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

void javawrapper::OutputBehaviors::ChangeOfSpecies int  iOldNumSpecies,
int[]  p_iIndexer
[inline]
 

Checks detailed output settings upon change of species.

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.

Reimplemented from javawrapper::WorkerBase.

void javawrapper::OutputBehaviors::ClearDetailedGridSettings  )  [inline]
 

Deletes all detailed output grid settings.


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

void javawrapper::OutputBehaviors::ClearDetailedTreeSettings  )  [inline]
 

Deletes all detailed output tree settings.


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

void javawrapper::OutputBehaviors::DisplayWindow MainWindow  oWindow  )  [inline, package]
 

Displays the output setup options.

Parameters:
oWindow Main application window.

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

void javawrapper::OutputBehaviors::DoSetup TreePopulation  oPop  )  throws javawrapper.ModelException [inline, virtual]
 

Performs setup.

Parameters:
oPop TreePopulation object.
Exceptions:
javawrapper.ModelException Doesn't throw this exception.

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

Implements javawrapper::WorkerBase.

Vector javawrapper::OutputBehaviors::FormatDataForDisplay TreePopulation  oPop  )  [inline]
 

This has its own display window; it won't contribute data to the display.

Parameters:
oPop TreePopulation object.
Returns:
null.

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

Reimplemented from javawrapper::WorkerBase.

DetailedGridSettings javawrapper::OutputBehaviors::GetDetailedGridSetting int  iIndex  )  [inline]
 

Returns the detailed output grid setting at a specified index.

Parameters:
iIndex The index.
Returns:
The DetailedGridSettings object, or null if the index is invalid.

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

String javawrapper::OutputBehaviors::GetDetailedOutputFileName  )  [inline]
 

Gets the detailed output filename.

Returns:
Filename.

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

DetailedTreeSettings javawrapper::OutputBehaviors::GetDetailedTreeSetting int  iIndex  )  [inline]
 

Returns the detailed output tree setting at a specified index.

Parameters:
iIndex The index.
Returns:
The DetailedTreeSettings object, or null if the index is invalid.

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

int javawrapper::OutputBehaviors::GetNumberOfDetailedGridSettings  )  [inline]
 

Gets the number of grid settings for which there is detailed output info.

Returns:
Number of settings.

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

int javawrapper::OutputBehaviors::GetNumberOfDetailedTreeSettings  )  [inline]
 

Gets the number of tree settings for which there is detailed output info (each setting is one tree species/type combo).

Returns:
Number of settings.

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

boolean javawrapper::OutputBehaviors::GetSaveAbsoluteBasalArea int  iType  )  throws ModelException [inline]
 

Gets whether or not absolute basal area is saved for a tree type.

Parameters:
iType Tree type.
Returns:
Save flag.
Exceptions:
ModelException if the type is not valid.

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

boolean javawrapper::OutputBehaviors::GetSaveAbsoluteDensity int  iType  )  throws ModelException [inline]
 

Gets whether or not absolute density is saved for a tree type.

Parameters:
iType Tree type.
Returns:
Save flag.
Exceptions:
ModelException if the type is not valid.

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

boolean javawrapper::OutputBehaviors::GetSaveRelativeBasalArea int  iType  )  throws ModelException [inline]
 

Gets whether or not relative basal area is saved for a tree type.

Parameters:
iType Tree type.
Returns:
Save flag.
Exceptions:
ModelException if the type is not valid.

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

boolean javawrapper::OutputBehaviors::GetSaveRelativeDensity int  iType  )  throws ModelException [inline]
 

Gets whether or not relative density is saved for a tree type.

Parameters:
iType Tree type.
Returns:
Save flag.
Exceptions:
ModelException if the type is not valid.

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

String javawrapper::OutputBehaviors::GetShortOutputFileName  )  [inline]
 

Gets the short output filename.

Returns:
Filename.

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

TreePopulation javawrapper::OutputBehaviors::GetTreePopulation  )  [inline]
 

Gets the tree population.

Returns:
Tree population.

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

void javawrapper::OutputBehaviors::ReadXMLParentTag String  sXMLTag,
Attributes  oAttributes
throws ModelException [inline]
 

Accepts an XML parent tag (empty, no data) from the parser.

This function watches for the following output tags:

  • ou_treeInfo
  • ou_gridInfo
  • so_treeTypeInfo
  • so_saveRBA
  • so_saveABA
  • so_saveRDN
  • so_saveADN
  • po_point
Parameters:
sXMLTag The XML tag.
oAttributes The attributes of this object.
Exceptions:
ModelException if data is missing or invalid.

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

Reimplemented from javawrapper::BehaviorTypeBase.

boolean javawrapper::OutputBehaviors::SavingShortOutputData  )  [inline]
 

Gets whether or not short output is being saved.

Returns:
Save status.

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

void javawrapper::OutputBehaviors::SetDetailedOutputFileName String  sFilename  )  [inline]
 

Sets the detailed output filename.

Parameters:
sFilename Filename.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
November 18, 2004: Added extension enforcement (LEM)
December 3, 2004: Fixed a bug when the filename was empty (LEM)

void javawrapper::OutputBehaviors::SetSaveAbsoluteBasalArea int  iType,
boolean  bUse
throws ModelException [inline]
 

Sets the save absolute basal area attribute for a type.

This is ignored if it's not sapling or adult.

Parameters:
iType Tree type.
bUse Whether or not to use this.
Exceptions:
ModelException If the type is not valid.

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

void javawrapper::OutputBehaviors::SetSaveAbsoluteDensity int  iType,
boolean  bUse
throws ModelException [inline]
 

Sets the save absolute density attribute for a type.

Parameters:
iType Tree type.
bUse Whether or not to use this.
Exceptions:
ModelException If the type is not valid.

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

void javawrapper::OutputBehaviors::SetSaveRelativeBasalArea int  iType,
boolean  bUse
throws ModelException [inline]
 

Sets the save relative basal area attribute for a type.

This is ignored if it's not sapling or adult.

Parameters:
iType Tree type.
bUse Whether or not to use this.
Exceptions:
ModelException If the type is not valid.

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

void javawrapper::OutputBehaviors::SetSaveRelativeDensity int  iType,
boolean  bUse
throws ModelException [inline]
 

Sets the save relative density attribute for a type.

Parameters:
iType Tree type.
bUse Whether or not to use this.
Exceptions:
ModelException If the type is not valid.

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

void javawrapper::OutputBehaviors::SetShortOutputFileName String  sFilename  )  [inline]
 

Sets the short output filename.

Parameters:
sFilename Filename.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
November 18, 2004: Added extension enforcement (LEM)
December 3, 2004: Fixed a bug when the filename was empty (LEM)

boolean javawrapper::OutputBehaviors::SetSingleValueByXMLTag String  sXMLTag,
String  sXMLParentTag,
Attributes  oAttributes,
Object  oData
throws ModelException [inline]
 

Sets a data object's value.

Overriden from the base class to capture output settings.

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 XML tag
oData Data value 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)
November 2, 2005: Added new substrate grid names for backwards compatibility (which I should have done in 6.05) (LEM)

Reimplemented from javawrapper::BehaviorTypeBase.

boolean javawrapper::OutputBehaviors::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.

Overridden from the base class. Due to the vagaries of parameter file parsing, our values may come in through here instead of in single values because there could be repeats.

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 from javawrapper::BehaviorTypeBase.

void javawrapper::OutputBehaviors::UpdateIsEnabled Behavior  oBeh  )  [inline, protected]
 

Keeps the behavior enabled flag current.

Any change of save flags has the potential to enable the behavior (by making the first save flag true) or unenabling (by making the last save flag false).

Parameters:
oBeh Behavior to check.

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

void javawrapper::OutputBehaviors::ValidateData TreePopulation  oPop  )  throws ModelException [inline, virtual]
 

Validates the data before writing to a parameter file.

Exceptions:
ModelException if the filename is empty but there are save settings.
Parameters:
oPop Not used.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
October 28, 2005: Fixed a bug by double-checking to make sure that all enabled detailed output settings still belonged to a behavior (LEM)

Implements javawrapper::WorkerBase.

void javawrapper::OutputBehaviors::WriteDetailedOutputXML BufferedWriter  jOut,
TreePopulation  oPop
throws java.io. IOException, ModelException [inline, protected]
 

Writes the parameter file data for detailed output.

Does nothing if there are no detailed output save settings.

Parameters:
jOut File to write
oPop TreePopulation object
Exceptions:
java.io.IOException passed through from file writing
ModelException passed through from tree population

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

void javawrapper::OutputBehaviors::WriteShortOutputXML BufferedWriter  jOut  )  throws java.io. IOException [inline, protected]
 

Writes the parameter file data for short output.

Does nothing if there are no short output save settings.

Parameters:
jOut File to write
Exceptions:
java.io.IOException passed through from file writing

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

void javawrapper::OutputBehaviors::WriteXML BufferedWriter  jOut,
TreePopulation  oPop
throws ModelException [inline]
 

Overridden from base because output parameters are special.

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

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

Reimplemented from javawrapper::BehaviorTypeBase.


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