# Class ParameterDB

    java.lang.Object
       |
       +----ParameterDB

class ParameterDB
extends Object

This class contains a Properties object that is used to store all of the parameter names and their corresponding values. It contains a secondary Property object that is initialized with the default values of the parameters as described in Chapter 5 of the lil-gp User's Manual. More importantly, this class contains all of the methods responsible for parsing the parameter values for errors before the output file can be generated. This class also contains a Vector object that is used to store errors encountered while parsing the database. Once the parse is complete, an ErrorFrame is instantiated and the error Vector is passed in.

See Also:
  ErrorFrame

##

endl

##

ParameterDB()
  The constructor method is responsible for creating a default Property object and instantiating the main Property object.

##

addToDB(String, String)
  This method allows external classes to request that a parameter be added to the database.
delFromDB(String)
  This method allows external classes to request that a parameter be deleted from the database.
displayErrors()
  This method is responsible for creating the ErrorFrame.
dump()
  A useful debugging method that dumps the contents of the database
getElements()
  This method allows external classes to request an Enumeration of the elements in the parameter database.
getKeys()
  This method allows external classes to request an Enumeration of the keys in the parameter database.
getProp(String)
  This method allows external classes to request a specific parameter in the database.
OLDsave(String)
  This method is responsible for generating the output file that will be used as input for lil-gp.
open(String)
  This method is repsonsible for opening an existing parameter file and reading the contents into a temporary hashtable.
parse()
  This method simply adds informative comments to the error Vector add calls the appropriate parse methods for each panel.
purgeOldPhases()
  This method will purge all parameters associated with breeding phases from the database.
purgeOldSubPopExchanges()
  This method will purge all of the parameters associated with exchanges between sub-populations.
purgeOldSubPopParameters()
  This method purges the parameters associated with multiple sub-populations, but does not purge the parameters associated with the actual sub-pop exchanges.
purgeUserDefinedParameters()
save(String)

##

endl

      public static String endl

##

ParameterDB

      public ParameterDB()

  The constructor method is responsible for creating a default Property object and instantiating the main Property object.

##

getKeys

      public Enumeration getKeys()

  This method allows external classes to request an Enumeration of the keys in the parameter database.
  Returns:
    an Enumeration of the keys

getElements

      public Enumeration getElements()

  This method allows external classes to request an Enumeration of the elements in the parameter database.
  Returns:
    an Enumeration of the elements

getProp

      public String getProp(String key)

  This method allows external classes to request a specific parameter in the database.
  Parameters:
    key - String object containing the desired property key
  Returns:
    the value associated with key

addToDB

      public void addToDB(String name,
                          String value)

  This method allows external classes to request that a parameter be added to the database. If the parameter is already in the database, its old value is replaced with the specified value.
  Parameters:
    name - String object containing the name of the parameter
    value - String object containing the value of the parameter.

delFromDB

      public void delFromDB(String name)

  This method allows external classes to request that a parameter be deleted from the database.
  Parameters:
    name - String object containing the name of the parameter

purgeOldPhases

      public void purgeOldPhases()

  This method will purge all parameters associated with breeding phases from the database. It is called when the user clicks on the 'purge' button on the BreedingPanel and before adding new breed phase parameters when the user clicks the 'accept' button.

purgeOldSubPopExchanges

      public void purgeOldSubPopExchanges()

  This method will purge all of the parameters associated with exchanges between sub-populations. It does not remove the following parameters:
  - multiple.sub_pops
  - multiple.exch_gen
  - multiple.exchanges
  It is called when the user clicks on the 'purge' button on the SubPopsPanel and also before new exchanges are added to the database.
  See Also:
    purgeOldSubPopParameters

purgeUserDefinedParameters

      public void purgeUserDefinedParameters()

purgeOldSubPopParameters

      public void purgeOldSubPopParameters()

  This method purges the parameters associated with multiple sub-populations, but does not purge the parameters associated with the actual sub-pop exchanges. It is called when the user clicks on the 'purge' button and before new sub-pop parameters are added to the database.
  See Also:
    purgeOldSubPopExchanges

OLDsave

      public void OLDsave(String filename) throws IOException

  This method is responsible for generating the output file that will be used as input for lil-gp. Before generating the file, it parses the parameters for errors. If there are no errors, a FileOutputStream is created and the file is generated. The parameters are grouped in the file by category and comments are inserted to help make it readable.
  Parameters:
    filename - String object containing the name of the output file
  See Also:
    parse

save

      public void save(String filename) throws IOException

open

      public void open(String filename) throws IOException

  This method is repsonsible for opening an existing parameter file and reading the contents into a temporary hashtable. If it encounters any unexpected errors in the parameter file, it will abort the open process. That is, it will leave the current settings on all of the panels intact and show the user where the error occurred. If there are no sytax errors in the file, then the parameters are run through the `parse()` method. If there are no errors in the parameter settings, then the `loadParams()` method is called for each panel.
  Parameters:
    filename - the name of the input file
  See Also:
    loadParams, loadParams, loadParams, loadParams, loadParams, loadParams, loadParams, loadParams

dump

      public void dump()

  A useful debugging method that dumps the contents of the database

displayErrors

      public void displayErrors()

  This method is responsible for creating the ErrorFrame.
  See Also:
    ErrorFrame, addComment, addWarning, addError

parse

      public boolean parse()

  This method simply adds informative comments to the error Vector add calls the appropriate parse methods for each panel. If there were any errors or warnings encountered while parsing the parameters, then return false.
  Returns:
    true if there were no errors or warnings, else return false
  See Also:
    parseGeneralPanel, parseOutputPanel, parseLimitsPanel, parseInitPanel, parseBreedingPanel, parseSubPopsPanel