SORTIE Java Interface  1
Public Member Functions | Private Attributes | List of all members
sortie.datavisualizer.DetailedOutputTimestepParseHandler Class Reference

An object of this class will parse detailed output timestep files and pass the data to a DetailedOutputFileManager object. More...

Inheritance diagram for sortie.datavisualizer.DetailedOutputTimestepParseHandler:

Public Member Functions

 DetailedOutputTimestepParseHandler (DetailedOutputFileManager oData)
 Constructor. More...
 
void startElement (java.lang.String sURI, java.lang.String sLocalName, java.lang.String sQName, Attributes oAttributes) throws SAXException
 Called when the parser hits a new opening tag. More...
 
void endElement (java.lang.String sURI, java.lang.String sLocalName, java.lang.String sQName) throws SAXException
 Feeds accumulated character data. More...
 
void characters (char[] ch, int start, int length) throws SAXException
 Reads character data from the XML file and appends it to the buffer. More...
 

Private Attributes

DetailedOutputFileManager m_oData
 Parent detailed output file manager. More...
 
StringBuffer m_sBuf
 String buffer for collecting character data. More...
 
String m_sDataMemberLabel
 Data member label. More...
 
int m_iSpecies
 Tree species. More...
 
boolean m_bIsGridXCellLength
 Indicates the data just parsed is the X length of grid cells. More...
 

Detailed Description

An object of this class will parse detailed output timestep files and pass the data to a DetailedOutputFileManager object.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
March 21, 2005: Fixed bug so we can differentiate between package and non-package grid data members (LEM)
March 20, 2006: Added grid package data parsing (LEM)
March 3, 2011: Added support for dead trees (LEM)

Constructor & Destructor Documentation

◆ DetailedOutputTimestepParseHandler()

sortie.datavisualizer.DetailedOutputTimestepParseHandler.DetailedOutputTimestepParseHandler ( DetailedOutputFileManager  oData)

Constructor.

Parameters
oDataParent detailed output file manager.

Member Function Documentation

◆ characters()

void sortie.datavisualizer.DetailedOutputTimestepParseHandler.characters ( char []  ch,
int  start,
int  length 
) throws SAXException

Reads character data from the XML file and appends it to the buffer.

The parser can call this multiple times per tag.

Parameters
chThe characters from the XML document.
start- The start position in the array.
length- The number of characters to read from the array.
Exceptions
SAXExceptionif any of the described cases above is true.

◆ endElement()

void sortie.datavisualizer.DetailedOutputTimestepParseHandler.endElement ( java.lang.String  sURI,
java.lang.String  sLocalName,
java.lang.String  sQName 
) throws SAXException

Feeds accumulated character data.

Whether or not the data is ignored, and what is done with it if it is not ignored, depends on flags that have been set.

Parameters
sURIthe Namespace URI (ignored)
sLocalNamethe local name (what this function looks at)
sQNamethe qualified (prefixed) name (ignored)
Exceptions
SAXExceptionif there are any problems.

◆ startElement()

void sortie.datavisualizer.DetailedOutputTimestepParseHandler.startElement ( java.lang.String  sURI,
java.lang.String  sLocalName,
java.lang.String  sQName,
Attributes  oAttributes 
) throws SAXException

Called when the parser hits a new opening tag.

This is overridden from the base class. This function is interested in the following tags:

Tree settings information:

  • tm_treeSettings - the species and type are saved.
  • tm_floatCode - the label is extracted and m_bIsFloatCode and m_bIsSettings are set to true.
  • tm_intCode - the label is extracted and m_bIsIntCode and m_bIsSettings are set to true.
  • tm_charCode - the label is extracted and m_bIsCharCode and m_bIsSettings are set to true.
  • tm_boolCode - the label is extracted and m_bIsBoolCode and m_bIsSettings are set to true.

Tree data:

  • tree - the species and type are extracted and set in m_iSpecies and m_iType.
  • fl - m_bWantsTreeFloat is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • int - m_bWantsTreeInt is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • ch - m_bWantsTreeChar is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • bl - m_bWantsTreeBool is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • ghost - the species, type, and dead code are extracted and set in m_iSpecies, m_iType, and m_iDeadCode.
  • gfl - m_bWantsDeadTreeFloat is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • gint - m_bWantsDeadTreeInt is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • gch - m_bWantsDeadTreeChar is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • gbl - m_bWantsDeadTreeBool is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.

Grid settings information:

  • grid - m_sGridName is set.
  • ma_floatCode - the label is extracted and m_bIsFloatCode and m_bIsSettings are set to true.
  • ma_intCode - the label is extracted and m_bIsIntCode and m_bIsSettings are set to true.
  • ma_charCode - the label is extracted and m_bIsCharCode and m_bIsSettings are set to true.
  • ma_boolCode - the label is extracted and m_bIsBoolCode and m_bIsSettings are set to true.
  • Something starting with "ma_package" - m_bIsPackage is set to true.

Grid data:

  • ma_v - m_iX and m_iY is extracted from the attributes.
  • fl - m_bWantsGridFloat is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • int - m_bWantsGridInt is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • ch - m_bWantsGridChar is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • bl - m_bWantsGridBool is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • pfl - m_bWantsGridPackageFloat is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • pint - m_bWantsGridPackageInt is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • pch - m_bWantsGridPackageChar is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • pbl - m_bWantsGridPackageBool is checked. If true, the data member code is extracted from the attributes and placed in m_sDataMemberLabel.
  • ma_lengthXCells - m_bIsGridXCellLength is set to true.
  • ma_lengthYCells - m_bIsGridYCellLength is set to true.
  • pkg - m_bIsPackage is set to true.
Parameters
sURIthe Namespace URI (ignored)
sLocalNamethe local name (what this function looks at)
sQNamethe qualified (prefixed) name (ignored)
oAttributesThe tag's oAttributes
Exceptions
SAXExceptionif there are any problems.

Member Data Documentation

◆ m_bIsGridXCellLength

boolean sortie.datavisualizer.DetailedOutputTimestepParseHandler.m_bIsGridXCellLength
private

Indicates the data just parsed is the X length of grid cells.

◆ m_iSpecies

int sortie.datavisualizer.DetailedOutputTimestepParseHandler.m_iSpecies
private

Tree species.

◆ m_oData

DetailedOutputFileManager sortie.datavisualizer.DetailedOutputTimestepParseHandler.m_oData
private

Parent detailed output file manager.

◆ m_sBuf

StringBuffer sortie.datavisualizer.DetailedOutputTimestepParseHandler.m_sBuf
private

String buffer for collecting character data.

◆ m_sDataMemberLabel

String sortie.datavisualizer.DetailedOutputTimestepParseHandler.m_sDataMemberLabel
private

Data member label.


The documentation for this class was generated from the following file: