javawrapper::Grid Class Reference

This class represents grids in the core model. More...

List of all members.

Public Member Functions

 Grid (String sGridName, DataMember[] p_oMembers, DataMember[] p_oPackageMembers, float fXCellLength, float fYCellLength)
 Constructor.
void SetGridFloatCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a float data member.
void SetGridIntCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for an int data member.
void SetGridCharCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a char data member.
void SetGridBoolCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a bool data member.
void SetGridPackageFloatCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a package float data member.
void SetGridPackageIntCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a package integer data member.
void SetGridPackageCharCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a package char data member.
void SetGridPackageBoolCode (String sDataMember, int iIndex) throws ModelException
 Sets the XML grid map code for a package bool data member.
void SetGridValue (int iX, int iY, int iCode, Integer iValue, Plot oPlot) throws ModelException
 Sets a grid map integer value.
void SetGridValue (int iX, int iY, int iCode, Float fValue, Plot oPlot) throws ModelException
 Sets a grid map float value.
void SetGridValue (int iX, int iY, int iCode, String sValue, Plot oPlot) throws ModelException
 Sets a grid map char value.
void SetGridValue (int iX, int iY, int iCode, Boolean bValue, Plot oPlot) throws ModelException
 Sets a grid map bool value.
void SetGridPackageValue (int iX, int iY, int iPackageIndex, int iCode, Integer iValue, Plot oPlot) throws ModelException
 Sets a grid map package integer value.
void SetGridPackageValue (int iX, int iY, int iPackageIndex, int iCode, Float fValue, Plot oPlot) throws ModelException
 Sets a grid map package float value.
void SetGridPackageValue (int iX, int iY, int iPackageIndex, int iCode, String sValue, Plot oPlot) throws ModelException
 Sets a grid map package char value.
void SetGridPackageValue (int iX, int iY, int iPackageIndex, int iCode, Boolean bValue, Plot oPlot) throws ModelException
 Sets a grid map package bool value.
String GetName ()
 Gets the grid's name.
float GetXCellLength ()
 Gets the X cell length for this grid.
float GetYCellLength ()
 Gets the Y cell length for this grid.
void SetXCellLength (float fXCellLength) throws ModelException
 Sets the length of cells in the X direction.
void SetYCellLength (float fYCellLength) throws ModelException
 Sets the length of cells in the Y direction.
void ClearMapValues ()
 Erases all current grid map values without touching any other settings.
DataMember[] GetDataMembers ()
 Gets the list of data members.
void SetDataMembers (DataMember[] p_oNewDataMembers)
 Sets the list of data members.
DataMember[] GetPackageDataMembers ()
 Gets the list of package data members.
void WriteXML (BufferedWriter oOut, Plot oPlot) throws ModelException
 Writes the grid's XML grid map to a file.

Protected Member Functions

PackageGridValue GetPackageGridValue (GridValue oCell, int iPackageIndex) throws ModelException
 Finds a requested package for a grid cell, or creates a new one if it does not already exist.
GridValue GetGridValue (int iX, int iY, Plot oPlot) throws ModelException
 Finds a requested grid cell, or creates a new one if it does not already exist.

Protected Attributes

DataMember[] mp_oDataMembers
 This is a list of the data members in a grid and thus available for saving in detailed output files etc.
DataMember[] mp_oPackageDataMembers
 This is a list of the package data members in a grid and thus available for saving in detailed output files etc.
String[] mp_sIntDataMembers
 Code names of int data members.
String[] mp_sFloatDataMembers
 Code names of float data members.
String[] mp_sCharDataMembers
 Code names of char data members.
String[] mp_sBoolDataMembers
 Code names of bool data members.
String[] mp_sPackageIntDataMembers
 Code names of package int data members, if different from main list.
String[] mp_sPackageFloatDataMembers
 Code names of package float data members, if different from main list.
String[] mp_sPackageCharDataMembers
 Code names of package char data members, if different from main list.
String[] mp_sPackageBoolDataMembers
 Code names of package bool data members, if different from main list.
String m_sGridName
 This is the grid's name - it should match the one in the code.
float m_fLengthXCells
 Length of cells in the X direction - optional.
float m_fLengthYCells
 Length of cells in the Y direction - optional.
boolean m_bEdited = false
 Whether or not this grid has been edited.
Vector mp_oGridVals
 Holds GridValue objects to be written to a grid map.
Vector mp_iGridIntTransforms
 Index position for integer data members.
Vector mp_iGridFloatTransforms
 Index position for float data members.
Vector mp_iGridCharTransforms
 Index position for char data members.
Vector mp_iGridBoolTransforms
 Index position for bool data members.
Vector mp_iGridPackageIntTransforms
 Index position for package integer data members.
Vector mp_iGridPackageFloatTransforms
 Index position for package float data members.
Vector mp_iGridPackageCharTransforms
 Index position for package char data members.
Vector mp_iGridPackageBoolTransforms
 Index position for package bool data members.

Package Functions

int GetFloatCode (String sCodeName)
 Gets the code for a float data member.
int GetIntCode (String sCodeName)
 Gets the code for an int data member.
int GetBoolCode (String sCodeName)
 Gets the code for a bool data member.
int GetCharCode (String sCodeName)
 Gets the code for a char data member.


Detailed Description

This class represents grids in the core model.

Objects of this class control data saving for grids.

This will keep track of a custom cell length in the X and Y directions. It is possible to change this at any time, but results could be disastrous if there is existing grid map data; it will not be updated to reflect the change.

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::Grid::Grid String  sGridName,
DataMember[]  p_oMembers,
DataMember[]  p_oPackageMembers,
float  fXCellLength,
float  fYCellLength
[inline]
 

Constructor.

Parameters:
p_oMembers The data members for this grid.
p_oPackageMembers The package data members for this grid, or NULL if there are no package data members.
sGridName The name of the grid. This should match the name of the grid in the code.
fXCellLength Length of cells in the X direction, in m
fYCellLength Length of cells in the Y direction, in m

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


Member Function Documentation

void javawrapper::Grid::ClearMapValues  )  [inline]
 

Erases all current grid map values without touching any other settings.


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

int javawrapper::Grid::GetBoolCode String  sCodeName  )  [inline, package]
 

Gets the code for a bool data member.

Parameters:
sCodeName String Code name (NOT display name) of data member.
Returns:
int Code, or -1 if the name is not recognized.

int javawrapper::Grid::GetCharCode String  sCodeName  )  [inline, package]
 

Gets the code for a char data member.

Parameters:
sCodeName String Code name (NOT display name) of data member.
Returns:
int Code, or -1 if the name is not recognized.

DataMember [] javawrapper::Grid::GetDataMembers  )  [inline]
 

Gets the list of data members.

Returns:
The list of data members.

int javawrapper::Grid::GetFloatCode String  sCodeName  )  [inline, package]
 

Gets the code for a float data member.

Parameters:
sCodeName String Code name (NOT display name) of data member.
Returns:
int Code, or -1 if the name is not recognized.

GridValue javawrapper::Grid::GetGridValue int  iX,
int  iY,
Plot  oPlot
throws ModelException [inline, protected]
 

Finds a requested grid cell, or creates a new one if it does not already exist.

Parameters:
iX X grid coordinate.
iY Y grid coordinate.
oPlot Plot object.
Returns:
GridValue object.
Exceptions:
ModelException if the coordinates are invalid.

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

int javawrapper::Grid::GetIntCode String  sCodeName  )  [inline, package]
 

Gets the code for an int data member.

Parameters:
sCodeName String Code name (NOT display name) of data member.
Returns:
int Code, or -1 if the name is not recognized.

String javawrapper::Grid::GetName  )  [inline]
 

Gets the grid's name.

Returns:
The name.

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

DataMember [] javawrapper::Grid::GetPackageDataMembers  )  [inline]
 

Gets the list of package data members.

Returns:
The list of package data members, or NULL if there are no separate package data members.

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

PackageGridValue javawrapper::Grid::GetPackageGridValue GridValue  oCell,
int  iPackageIndex
throws ModelException [inline, protected]
 

Finds a requested package for a grid cell, or creates a new one if it does not already exist.

Parameters:
oCell Cell for which to get the package.
iPackageIndex Index of the package to get in the package list of the cell, starting at 0.
Returns:
PackageGridValue object.
Exceptions:
ModelException if the coordinates are invalid, or if the package index is higher than 1 + the number of packages already in the cell.

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

float javawrapper::Grid::GetXCellLength  )  [inline]
 

Gets the X cell length for this grid.

Returns:
X cell length, in meters.

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

float javawrapper::Grid::GetYCellLength  )  [inline]
 

Gets the Y cell length for this grid.

Returns:
Y cell length, in meters.

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

void javawrapper::Grid::SetDataMembers DataMember[]  p_oNewDataMembers  )  [inline]
 

Sets the list of data members.

Parameters:
p_oNewDataMembers The list of data members.

void javawrapper::Grid::SetGridBoolCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a bool data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridCharCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a char data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridFloatCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a float data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridIntCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for an int data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridPackageBoolCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a package bool data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridPackageCharCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a package char data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridPackageFloatCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a package float data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridPackageIntCode String  sDataMember,
int  iIndex
throws ModelException [inline]
 

Sets the XML grid map code for a package integer data member.

Parameters:
sDataMember Data member code name.
iIndex Code number.
Exceptions:
ModelException if the data member isn't recognized.

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

void javawrapper::Grid::SetGridPackageValue int  iX,
int  iY,
int  iPackageIndex,
int  iCode,
Boolean  bValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map package bool value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iPackageIndex Package index number.
iCode Index at which to set the value.
bValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridPackageValue int  iX,
int  iY,
int  iPackageIndex,
int  iCode,
String  sValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map package char value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iPackageIndex Package index number.
iCode Index at which to set the value.
sValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridPackageValue int  iX,
int  iY,
int  iPackageIndex,
int  iCode,
Float  fValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map package float value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iPackageIndex Package index number.
iCode Index at which to set the value.
fValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridPackageValue int  iX,
int  iY,
int  iPackageIndex,
int  iCode,
Integer  iValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map package integer value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iPackageIndex Package index number.
iCode Index at which to set the value.
iValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridValue int  iX,
int  iY,
int  iCode,
Boolean  bValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map bool value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iCode Index at which to set the value.
bValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridValue int  iX,
int  iY,
int  iCode,
String  sValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map char value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iCode Index at which to set the value.
sValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridValue int  iX,
int  iY,
int  iCode,
Float  fValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map float value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iCode Index at which to set the value.
fValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetGridValue int  iX,
int  iY,
int  iCode,
Integer  iValue,
Plot  oPlot
throws ModelException [inline]
 

Sets a grid map integer value.

This will assume that the code needs to go through the transform array - i.e. it needs translating from the local grid map reference point.

Parameters:
iX X grid cell coordinate.
iY Y grid cell coordinate.
iCode Index at which to set the value.
iValue Value to set.
oPlot Plot object.
Exceptions:
ModelException 
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::Grid::SetXCellLength float  fXCellLength  )  throws ModelException [inline]
 

Sets the length of cells in the X direction.

If the length of Y is 0, it will be set to the same value.

Parameters:
fXCellLength Length of cells in the X direction, in meters.
Exceptions:
ModelException If the value is negative.

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

void javawrapper::Grid::SetYCellLength float  fYCellLength  )  throws ModelException [inline]
 

Sets the length of cells in the Y direction.

If the length of X is 0, it will be set to the same value.

Parameters:
fYCellLength Length of cells in the Y direction, in meters.
Exceptions:
ModelException If the value is negative.

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

void javawrapper::Grid::WriteXML BufferedWriter  oOut,
Plot  oPlot
throws ModelException [inline]
 

Writes the grid's XML grid map to a file.

If there are no grid map values, this will not write anything.

Parameters:
oOut File stream to write to.
oPlot Plot object.
Exceptions:
ModelException if there is something wrong with the file.

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


Member Data Documentation

Vector javawrapper::Grid::mp_iGridBoolTransforms [protected]
 

Index position for bool data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridCharTransforms [protected]
 

Index position for char data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridFloatTransforms [protected]
 

Index position for float data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridIntTransforms [protected]
 

Index position for integer data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridPackageBoolTransforms [protected]
 

Index position for package bool data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridPackageCharTransforms [protected]
 

Index position for package char data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridPackageFloatTransforms [protected]
 

Index position for package float data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.

Vector javawrapper::Grid::mp_iGridPackageIntTransforms [protected]
 

Index position for package integer data members.

Vector position equals the data member position in the map being read, and vector value is the index for GridValue.


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