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 AddShortOutputSubplot (String sName)
 Creates a subplot for short output.
Subplot AddDetailedOutputSubplot (String sName)
 Creates a subplot for detailed output.
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, String[] p_sNewSpecies)
 Checks detailed output settings upon change of species.
void CopySpecies (int iSpeciesCopyFrom, int iSpeciesCopyTo) throws ModelException
 Updates output settings when species are copied.
void ChangeOfPlotResolution (float fOldX, float fOldY, float fNewX, float fNewY) throws ModelException
 Removes cells from subplots that are outside the plot.

Static Public Attributes

static final String DETAILED_OUTPUT_EXTENSION = ".gz.tar"
 File extension for the detailed output file.
static final String SUMMARY_EXTENSION = ".out"
 File extension for the summary output file.

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_oShortOutputSubplots = new Vector(0)
 For short output - the list of Subplot objects.
Vector mp_oDetailedOutputSubplots = new Vector(0)
 For detailed 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.

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)
May 11, 2006: Added subplot support to detailed output (LEM)
January 16, 2007: Made it so this dealt gracefully with species changes in grid save settings (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

Subplot javawrapper::OutputBehaviors::AddShortOutputSubplot ( String  sName  )  [inline]

Creates a subplot for short output.

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

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

Subplot javawrapper::OutputBehaviors::AddDetailedOutputSubplot ( String  sName  )  [inline]

Creates a subplot for detailed output.

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

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)

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

Gets the short output filename.

Returns:
Filename.

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)

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

Gets the detailed output filename.

Returns:
Filename.

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)

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)

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)

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)

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)

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

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

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.

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

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)

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.

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::ClearDetailedTreeSettings (  )  [inline]

Deletes all detailed output tree settings.


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

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

Deletes all detailed output grid settings.


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)

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)

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

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

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:

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

void javawrapper::OutputBehaviors::ChangeOfSpecies ( int  iOldNumSpecies,
int[]  p_iIndexer,
String[]  p_sNewSpecies 
) [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.
p_sNewSpecies The new species list.

Reimplemented from javawrapper::BehaviorTypeBase.

void javawrapper::OutputBehaviors::CopySpecies ( int  iSpeciesCopyFrom,
int  iSpeciesCopyTo 
) throws ModelException [inline]

Updates output settings when species are copied.

Parameters:
iSpeciesCopyFrom int Species to copy.
iSpeciesCopyTo int Species that is the copy.
Exceptions:
ModelException if there is a problem.

Reimplemented from javawrapper::BehaviorTypeBase.

void javawrapper::OutputBehaviors::ChangeOfPlotResolution ( float  fOldX,
float  fOldY,
float  fNewX,
float  fNewY 
) throws ModelException [inline]

Removes cells from subplots that are outside the plot.

Parameters:
fOldX float Old plot X length.
fOldY float Old plot Y length.
fNewX float New plot X length.
fNewY float New plot Y length.
Exceptions:
ModelException won't.

Reimplemented from javawrapper::WorkerBase.


Member Data Documentation

final String javawrapper::OutputBehaviors::DETAILED_OUTPUT_EXTENSION = ".gz.tar" [static]

File extension for the detailed output file.

final String javawrapper::OutputBehaviors::SUMMARY_EXTENSION = ".out" [static]

File extension for the summary output file.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:34:55 2007 for SORTIE Java Interface by  doxygen 1.5.2