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 SetPackageDataMembers (DataMember[] p_oNewDataMembers)
 Sets 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< GridValuemp_oGridVals = new Vector<GridValue>(0)
 Holds GridValue objects to be written to a grid map.
Vector< Integer > mp_iGridIntTransforms
 Index position for integer data members.
Vector< Integer > mp_iGridFloatTransforms
 Index position for float data members.
Vector< Integer > mp_iGridCharTransforms
 Index position for char data members.
Vector< Integer > mp_iGridBoolTransforms
 Index position for bool data members.
Vector< Integer > mp_iGridPackageIntTransforms
 Index position for package integer data members.
Vector< Integer > mp_iGridPackageFloatTransforms
 Index position for package float data members.
Vector< Integer > mp_iGridPackageCharTransforms
 Index position for package char data members.
Vector< Integer > 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)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Constructor & Destructor Documentation

javawrapper.Grid.Grid ( String  sGridName,
DataMember[]  p_oMembers,
DataMember[]  p_oPackageMembers,
float  fXCellLength,
float  fYCellLength 
)

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


Member Function Documentation

int javawrapper.Grid.GetFloatCode ( String  sCodeName  )  [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.

int javawrapper.Grid.GetIntCode ( String  sCodeName  )  [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.

int javawrapper.Grid.GetBoolCode ( String  sCodeName  )  [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  )  [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.

void javawrapper.Grid.SetGridFloatCode ( String  sDataMember,
int  iIndex 
) throws ModelException

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

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.SetGridCharCode ( String  sDataMember,
int  iIndex 
) throws ModelException

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.SetGridBoolCode ( String  sDataMember,
int  iIndex 
) throws ModelException

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.SetGridPackageFloatCode ( String  sDataMember,
int  iIndex 
) throws ModelException

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

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.SetGridPackageCharCode ( String  sDataMember,
int  iIndex 
) throws ModelException

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.SetGridPackageBoolCode ( String  sDataMember,
int  iIndex 
) throws ModelException

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.SetGridValue ( int  iX,
int  iY,
int  iCode,
Integer  iValue,
Plot  oPlot 
) throws ModelException

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.SetGridValue ( int  iX,
int  iY,
int  iCode,
Float  fValue,
Plot  oPlot 
) throws ModelException

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,
String  sValue,
Plot  oPlot 
) throws ModelException

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,
Boolean  bValue,
Plot  oPlot 
) throws ModelException

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.SetGridPackageValue ( int  iX,
int  iY,
int  iPackageIndex,
int  iCode,
Integer  iValue,
Plot  oPlot 
) throws ModelException

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.SetGridPackageValue ( int  iX,
int  iY,
int  iPackageIndex,
int  iCode,
Float  fValue,
Plot  oPlot 
) throws ModelException

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,
String  sValue,
Plot  oPlot 
) throws ModelException

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,
Boolean  bValue,
Plot  oPlot 
) throws ModelException

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)

PackageGridValue javawrapper.Grid.GetPackageGridValue ( GridValue  oCell,
int  iPackageIndex 
) throws ModelException [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)

GridValue javawrapper.Grid.GetGridValue ( int  iX,
int  iY,
Plot  oPlot 
) throws ModelException [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)

String javawrapper.Grid.GetName (  ) 

Gets the grid's name.

Returns:
The name.

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

float javawrapper.Grid.GetXCellLength (  ) 

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

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.SetXCellLength ( float  fXCellLength  )  throws ModelException

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

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.ClearMapValues (  ) 

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

DataMember [] javawrapper.Grid.GetDataMembers (  ) 

Gets the list of data members.

Returns:
The list of data members.

void javawrapper.Grid.SetDataMembers ( DataMember[]  p_oNewDataMembers  ) 

Sets the list of data members.

This should ONLY be used to rename data members.

Parameters:
p_oNewDataMembers The list of data members.

DataMember [] javawrapper.Grid.GetPackageDataMembers (  ) 

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)

void javawrapper.Grid.SetPackageDataMembers ( DataMember[]  p_oNewDataMembers  ) 

Sets the list of package data members.

This should ONLY be used to rename data members.

Parameters:
p_oNewDataMembers The list of data members.

void javawrapper.Grid.WriteXML ( BufferedWriter  oOut,
Plot  oPlot 
) throws ModelException

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

This is a list of the data members in a grid and thus available for saving in detailed output files etc.

This is a list of the package data members in a grid and thus available for saving in detailed output files etc.

String [] javawrapper.Grid.mp_sIntDataMembers [protected]

Code names of int data members.

Code names of float data members.

String [] javawrapper.Grid.mp_sCharDataMembers [protected]

Code names of char data members.

String [] javawrapper.Grid.mp_sBoolDataMembers [protected]

Code names of bool data members.

Code names of package int data members, if different from main list.

Code names of package float data members, if different from main list.

Code names of package char data members, if different from main list.

Code names of package bool data members, if different from main list.

String javawrapper.Grid.m_sGridName [protected]

This is the grid's name - it should match the one in the code.

Length of cells in the X direction - optional.

Length of cells in the Y direction - optional.

boolean javawrapper.Grid.m_bEdited = false [protected]

Whether or not this grid has been edited.

Vector<GridValue> javawrapper.Grid.mp_oGridVals = new Vector<GridValue>(0) [protected]

Holds GridValue objects to be written to a grid map.

Vector<Integer> 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<Integer> 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<Integer> 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<Integer> 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<Integer> 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.

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.

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.

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.


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

Generated on Wed Oct 28 14:01:20 2009 for SORTIE Java Interface by  doxygen 1.5.6