javawrapper.HarvestData Class Reference

This class encapsulates the data for a single harvest event - being for one timestep, for one cut type. More...

List of all members.

Public Member Functions

int GetCutAmountType ()
 Gets the cut amount type.
void SetCutAmountType (int iCut) throws ModelException
 Sets the cut amount type.
int GetCutType ()
 Gets the cut type.
void SetCutType (int iCut) throws ModelException
 Sets the cut type.
int GetTimestep ()
 Gets the timestep for this cut event.
void SetTimestep (int iTimestep) throws ModelException
 Sets the timestep for this cut event.
int GetNumberOfSpecies ()
 Gets the number of species to which this cut has been applied.
int GetSpecies (int iIndex) throws ModelException
 Gets a species at a certain index within the species list.
void AddSpecies (int iSpecies)
 Adds a new species to apply this harvest cut to.
void RemoveSpecies (int iSpecies)
 Removes a species from the list to which to apply this harvest.
void ClearSpecies ()
 Clears the list of species.
int GetNumberOfCutRanges ()
 Gets the number of cut ranges.
void AddCutRange (float fLow, float fHigh, float fAmountToCut) throws ModelException
 Adds a new cut range.
float GetLowerBound (int iCutRangeIndex) throws ModelException
 Gets the lower dbh bound value for a cut range.
float GetUpperBound (int iCutRangeIndex) throws ModelException
 Gets the upper dbh bound value for a cut range.
float GetCutAmount (int iCutRangeIndex) throws ModelException
 Gets the cut amount for a cut range.
int GetNumberOfCells ()
 Gets the number of cells in the cut range's cut area.
void AddCell (int iX, int iY, Plot oPlot) throws ModelException
 Adds a cell to the harvest cut range's area.
void AddCell (Cell oNewCell)
 Adds a cell to the harvest cut range's area.
void RemoveCell (int iIndex)
 Removes a cell from the harvest cut range's area.
Cell GetCell (int iIndex) throws ModelException
 Gets a cell in a harvest's cut area.
void ValidateCut (TreePopulation oPop, Plot oPlot) throws ModelException
 Validates the current set of data in this cut.

Static Public Attributes

static int NUMBER_ALLOWED_CUT_RANGES = 4
 Maximum number of allowed cut ranges.

Private Attributes

Vector< Integer > mp_iSpecies = new Vector<Integer>(0)
 Species codes to which to apply this harvest cut.
Vector< Cellmp_oCells = new Vector<Cell>(0)
 The list of cells to which to apply this cut (vector of Cell objects).
Vector< CutRangemp_oCutRanges = new Vector<CutRange>(0)
 The list of cut ranges and cut amounts (CutRange objects).
int m_iTimestep = -1
 Timestep to which to apply this harvest cut.
int m_iCutType = -1
 The cut type - possible values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT.
int m_iCutAmountType = -1
 How the cut amount is specified - possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY.


Detailed Description

This class encapsulates the data for a single harvest event - being for one timestep, for one cut type.

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)
November 19, 2005: Added species removal capacity (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Member Function Documentation

int javawrapper.HarvestData.GetCutAmountType (  ) 

Gets the cut amount type.

Possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY, or -1 if the value has not yet been set.

Returns:
The cut amount type.

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

void javawrapper.HarvestData.SetCutAmountType ( int  iCut  )  throws ModelException

Sets the cut amount type.

Parameters:
iCut the cut amount type. Possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY.
Exceptions:
ModelException if the cut amount type is unrecognized.

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

int javawrapper.HarvestData.GetCutType (  ) 

Gets the cut type.

Returns:
The cut type. Possible values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT, or -1 if the value has not been set.

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

void javawrapper.HarvestData.SetCutType ( int  iCut  )  throws ModelException

Sets the cut type.

Parameters:
iCut The cut type. Values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT.
Exceptions:
ModelException if the cut type is unrecognized.

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

int javawrapper.HarvestData.GetTimestep (  ) 

Gets the timestep for this cut event.

Returns:
The timestep.

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

void javawrapper.HarvestData.SetTimestep ( int  iTimestep  )  throws ModelException

Sets the timestep for this cut event.

Parameters:
iTimestep The timestep to set.
Exceptions:
ModelException if the timestep is less than 0.

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

int javawrapper.HarvestData.GetNumberOfSpecies (  ) 

Gets the number of species to which this cut has been applied.

Returns:
The number of species.

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

int javawrapper.HarvestData.GetSpecies ( int  iIndex  )  throws ModelException

Gets a species at a certain index within the species list.

Parameters:
iIndex The species index.
Returns:
The species value.
Exceptions:
ModelException If the index is not valid.

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

void javawrapper.HarvestData.AddSpecies ( int  iSpecies  ) 

Adds a new species to apply this harvest cut to.

If this species is already on the list, it is not added again.

Parameters:
iSpecies Species index.

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

void javawrapper.HarvestData.RemoveSpecies ( int  iSpecies  ) 

Removes a species from the list to which to apply this harvest.

If this species is not on the list, the function quietly exits.

Parameters:
iSpecies Species number (number identifying the species, NOT the index number in the vector).

void javawrapper.HarvestData.ClearSpecies (  ) 

Clears the list of species.

int javawrapper.HarvestData.GetNumberOfCutRanges (  ) 

Gets the number of cut ranges.

Returns:
Number of cut ranges.

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

void javawrapper.HarvestData.AddCutRange ( float  fLow,
float  fHigh,
float  fAmountToCut 
) throws ModelException

Adds a new cut range.

Parameters:
fLow Lower bound of the cut range, as a dbh in cm.
fHigh Upper bound of the cut range, as a dbh in cm.
fAmountToCut Amount to cut. If the amount cut type is as a percentage of either basal area or density, this is a percentage value between 0 and 100. If it is amount of basal area, this is basal area in square meters per hectare. If this is amount of density, this is number of trees per hectare.
Exceptions:
ModelException if any of the following are true:
  • This adds more than the maximum number of cut ranges allowed
  • A dbh bound value is less than 0
  • The upper bound value is less than the lower bound value
  • The amount to cut is negative
  • If the amount to cut is a percentage, the value is either less than 0 or greater than 100

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

float javawrapper.HarvestData.GetLowerBound ( int  iCutRangeIndex  )  throws ModelException

Gets the lower dbh bound value for a cut range.

Parameters:
iCutRangeIndex The cut range index.
Returns:
The lower bound.
Exceptions:
ModelException If the cut range is invalid.

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

float javawrapper.HarvestData.GetUpperBound ( int  iCutRangeIndex  )  throws ModelException

Gets the upper dbh bound value for a cut range.

Parameters:
iCutRangeIndex The cut range index.
Returns:
The upper bound.
Exceptions:
ModelException If the cut range is invalid.

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

float javawrapper.HarvestData.GetCutAmount ( int  iCutRangeIndex  )  throws ModelException

Gets the cut amount for a cut range.

Parameters:
iCutRangeIndex The cut range index.
Returns:
The cut amount.
Exceptions:
ModelException If the cut range is invalid.

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

int javawrapper.HarvestData.GetNumberOfCells (  ) 

Gets the number of cells in the cut range's cut area.

Returns:
Number of cells.

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

void javawrapper.HarvestData.AddCell ( int  iX,
int  iY,
Plot  oPlot 
) throws ModelException

Adds a cell to the harvest cut range's area.

Duplicates will not be added.

Parameters:
iX X cell number.
iY Y cell number.
oPlot a Plot object.
Exceptions:
ModelException if the cell coordinates are invalid.

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

void javawrapper.HarvestData.AddCell ( Cell  oNewCell  ) 

Adds a cell to the harvest cut range's area.

Duplicates will not be added.

Parameters:
oNewCell Cell object to add.

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

void javawrapper.HarvestData.RemoveCell ( int  iIndex  ) 

Removes a cell from the harvest cut range's area.

Parameters:
iIndex int Cell index. Invalid values are ignored.

Cell javawrapper.HarvestData.GetCell ( int  iIndex  )  throws ModelException

Gets a cell in a harvest's cut area.

Parameters:
iIndex The index of the object.
Returns:
The cell object.
Exceptions:
ModelException If the index is not valid.

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

void javawrapper.HarvestData.ValidateCut ( TreePopulation  oPop,
Plot  oPlot 
) throws ModelException

Validates the current set of data in this cut.

This makes sure the following are all true:

  • there is at least one species
  • all species are valid
  • a timestep has been specified
  • a cut type has been specified
  • a cut amount type have been specified
  • there is at least one grid cell to which to apply the cut
  • there is at least one cut range to which to apply the cut
Parameters:
oPop TreePopulation object, to help verify data
oPlot Plot object for timestep verification
Exceptions:
ModelException if any of the above conditions is not true

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


Member Data Documentation

Vector<Integer> javawrapper.HarvestData.mp_iSpecies = new Vector<Integer>(0) [private]

Species codes to which to apply this harvest cut.

Vector<Cell> javawrapper.HarvestData.mp_oCells = new Vector<Cell>(0) [private]

The list of cells to which to apply this cut (vector of Cell objects).

Vector<CutRange> javawrapper.HarvestData.mp_oCutRanges = new Vector<CutRange>(0) [private]

The list of cut ranges and cut amounts (CutRange objects).

Timestep to which to apply this harvest cut.

The cut type - possible values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT.

How the cut amount is specified - possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY.

Maximum number of allowed cut ranges.


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

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