shared
Class GetEnv

java.lang.Object
  |
  +--shared.GetEnv

public class GetEnv
extends java.lang.Object

This class replaces the functions of GetOption class. It provides access to the MLJ-Options.file for loading parameters and options for MLJ.


Constructor Summary
GetEnv()
          Constructor.
GetEnv(java.lang.String fileName)
          Constructor.
 
Method Summary
 int _get_option_enum(java.lang.String optionName, MEnum optionMEnum, java.lang.String optionHelp, boolean nuisance)
          Reads the value of an option as an Enum object.
 boolean get_option_bool(java.lang.String option)
          Returns the value of an boolean option of the specified name.
 boolean get_option_bool(java.lang.String optionName, boolean defaultValue, java.lang.String optionHelp)
          Returns the value of an boolean option of the specified name.
 boolean get_option_bool(java.lang.String option, boolean default_value, java.lang.String nuisance, boolean nuisance_flag)
          Returns the value of an boolean option of the specified name.
 void get_option_enum_no_default(java.lang.String optionName, MEnum optionMEnum, java.lang.String optionHelp, boolean nuisance, int returnVal)
          Reads the value of an option as an Enum object.
 int get_option_int_range(java.lang.String optionName, int defaultValue, int lowerBound, int upperBound)
          Returns the value of an integer option of the specified name between the given bounds.
 int get_option_int_range(java.lang.String optionName, int defaultValue, int lowerBound, int upperBound, java.lang.String optionHelp)
          Returns the value of an integer option of the specified name between the given bounds.
 int get_option_int_range(java.lang.String optionName, int defaultValue, int lowerBound, int upperBound, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an integer option of the specified name between the given bounds.
 int get_option_int_range(java.lang.String optionName, int defaultValue, int lowerBound, int upperBound, java.lang.String optionHelp, boolean nuisance, boolean noPrompt)
          Returns the value of an integer option of the specified name between the given bounds.
 int get_option_int_range(java.lang.String optionName, int lowerBound, int upperBound, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an integer option of the specified name between the given bounds.
 int get_option_int(java.lang.String option)
          Returns the value of an integer option of the specified name.
 int get_option_int(java.lang.String optionName, int defaultValue)
          Returns the value of an integer option of the specified name.
 int get_option_int(java.lang.String optionName, int defaultValue, java.lang.String optionHelp)
          Returns the value of an integer option of the specified name.
 int get_option_int(java.lang.String optionName, int defaultValue, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an integer option of the specified name.
 int get_option_int(java.lang.String optionName, int defaultValue, java.lang.String optionHelp, boolean nuisance, boolean noPrompt)
          Returns the value of an integer option of the specified name.
 int get_option_int(java.lang.String optionName, java.lang.String optionHelp)
          Returns the value of an integer option of the specified name.
 int get_option_int(java.lang.String optionName, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an integer option of the specified name.
 double get_option_real_range(java.lang.String option)
          Returns the max range of a real value option of the specified name.
 double get_option_real(java.lang.String optionName)
          Returns the value of an double option of the specified name.
 double get_option_real(java.lang.String optionName, double defaultValue)
          Returns the value of an double option of the specified name.
 double get_option_real(java.lang.String optionName, double defaultValue, java.lang.String optionHelp)
          Returns the value of an double option of the specified name.
 double get_option_real(java.lang.String optionName, double defaultValue, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an double option of the specified name.
 double get_option_real(java.lang.String optionName, double defaultValue, java.lang.String optionHelp, boolean nuisance, boolean noPrompt)
          Returns the value of an double option of the specified name.
 double get_option_real(java.lang.String optionName, java.lang.String optionHelp)
          Returns the value of an double option of the specified name.
 double get_option_real(java.lang.String optionName, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an double option of the specified name.
 java.lang.String get_option_string_no_default(java.lang.String optionName, java.lang.String optionHelp)
          Returns the value of an string option of the specified name.
 java.lang.String get_option_string_no_default(java.lang.String optionName, java.lang.String optionHelp, boolean nuisance)
          Returns the value of an string option of the specified name.
 java.lang.String get_option_string(java.lang.String option)
          A function which returns the string value following the option name within the options file.
 java.lang.String get_option_string(java.lang.String optionName, java.lang.String defaultValue, java.lang.String optionHelp, boolean nuisance)
          A function which returns the string value following the option name within the options file.
 java.lang.String get_option_string(java.lang.String optionName, java.lang.String defaultValue, java.lang.String optionHelp, boolean nuisance, boolean noPrompt)
          Returns the value of an string option of the specified name.
 java.lang.String getenv(java.lang.String in)
          A dummy function that returns null when called.
 java.lang.String MEnumOption(java.lang.String optionName, MEnum optionEnum, java.lang.String deflt, java.lang.String help, boolean nuisance, boolean noPrompt)
          Reads the value of an option as an MEnum object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetEnv

public GetEnv()
Constructor. Looks for the MLJ-Options.file in the working directory first and in the MLJ shared source directory second.

GetEnv

public GetEnv(java.lang.String fileName)
Constructor. Looks for the options file with the given name in the working directory first and in the MLJ shared source directory second.
Parameters:
fileName - The name of the file containing option values.
Method Detail

getenv

public java.lang.String getenv(java.lang.String in)
A dummy function that returns null when called.
Parameters:
in - Name of the environment variable requested.
Returns:
Always null.

get_option_int

public int get_option_int(java.lang.String option)
Returns the value of an integer option of the specified name.
Parameters:
option - The name of the option for which a value is requested.
Returns:
The value of the option if found, 0 otherwise.

get_option_string

public java.lang.String get_option_string(java.lang.String option)
A function which returns the string value following the option name within the options file.
Parameters:
option - The name of the option for which a value is requested.
Returns:
The value of the requested option.

get_option_string

public java.lang.String get_option_string(java.lang.String optionName,
                                          java.lang.String defaultValue,
                                          java.lang.String optionHelp,
                                          boolean nuisance)
A function which returns the string value following the option name within the options file.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_real_range

public double get_option_real_range(java.lang.String option)
Returns the max range of a real value option of the specified name.
Parameters:
option - The name of the option for which a value is requested.
Returns:
The value of the option if found, 0 otherwise.

get_option_bool

public boolean get_option_bool(java.lang.String option)
Returns the value of an boolean option of the specified name.
Parameters:
option - The name of the option for which a value is requested.
Returns:
The value of the option if found, false otherwise.

get_option_bool

public boolean get_option_bool(java.lang.String option,
                               boolean default_value,
                               java.lang.String nuisance,
                               boolean nuisance_flag)
Returns the value of an boolean option of the specified name.
Parameters:
option - The name of the option for which a value is requested.
default_value - The value of the option if not found in the options file.
nuisance - The String description for a help display.
nuisance_flag - Flag for nuisance value use.
Returns:
The value of the option if found, the default_value otherwise.

get_option_enum_no_default

public void get_option_enum_no_default(java.lang.String optionName,
                                       MEnum optionMEnum,
                                       java.lang.String optionHelp,
                                       boolean nuisance,
                                       int returnVal)
Reads the value of an option as an Enum object.
Parameters:
optionName - The name of the option for which a value is requested.
optionMEnum - The MEnum object that will hold the option values.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
returnVal - The values for the requested option.

_get_option_enum

public int _get_option_enum(java.lang.String optionName,
                            MEnum optionMEnum,
                            java.lang.String optionHelp,
                            boolean nuisance)
Reads the value of an option as an Enum object.
Parameters:
optionName - The name of the option for which a value is requested.
optionMEnum - The MEnum object that will hold the option values.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

MEnumOption

public java.lang.String MEnumOption(java.lang.String optionName,
                                    MEnum optionEnum,
                                    java.lang.String deflt,
                                    java.lang.String help,
                                    boolean nuisance,
                                    boolean noPrompt)
Reads the value of an option as an MEnum object.
Parameters:
optionName - The name of the option for which a value is requested.
optionEnum - The MEnum object that will hold the option values.
deflt - The default value for the option if it is not found in the option file.
help - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
noPrompt - TRUE if prompting always occurs regardless of wether option is set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_string_no_default

public java.lang.String get_option_string_no_default(java.lang.String optionName,
                                                     java.lang.String optionHelp)
Returns the value of an string option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_bool

public boolean get_option_bool(java.lang.String optionName,
                               boolean defaultValue,
                               java.lang.String optionHelp)
Returns the value of an boolean option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_int

public int get_option_int(java.lang.String optionName,
                          int defaultValue,
                          java.lang.String optionHelp,
                          boolean nuisance,
                          boolean noPrompt)
Returns the value of an integer option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
noPrompt - TRUE if prompting always occurs regardless of wether option is set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_int

public int get_option_int(java.lang.String optionName,
                          int defaultValue,
                          java.lang.String optionHelp)
Returns the value of an integer option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_int

public int get_option_int(java.lang.String optionName,
                          int defaultValue)
Returns the value of an integer option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
Returns:
The value for the requested option.

get_option_int

public int get_option_int(java.lang.String optionName,
                          int defaultValue,
                          java.lang.String optionHelp,
                          boolean nuisance)
Returns the value of an integer option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_string_no_default

public java.lang.String get_option_string_no_default(java.lang.String optionName,
                                                     java.lang.String optionHelp,
                                                     boolean nuisance)
Returns the value of an string option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_string

public java.lang.String get_option_string(java.lang.String optionName,
                                          java.lang.String defaultValue,
                                          java.lang.String optionHelp,
                                          boolean nuisance,
                                          boolean noPrompt)
Returns the value of an string option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
noPrompt - TRUE if prompting always occurs regardless of wether option is set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_int

public int get_option_int(java.lang.String optionName,
                          java.lang.String optionHelp)
Returns the value of an integer option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_int

public int get_option_int(java.lang.String optionName,
                          java.lang.String optionHelp,
                          boolean nuisance)
Returns the value of an integer option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_int_range

public int get_option_int_range(java.lang.String optionName,
                                int defaultValue,
                                int lowerBound,
                                int upperBound,
                                java.lang.String optionHelp,
                                boolean nuisance,
                                boolean noPrompt)
Returns the value of an integer option of the specified name between the given bounds.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
lowerBound - The lower bound for possible option values.
upperBound - The upper bound for possible values.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
noPrompt - TRUE if prompting always occurs regardless of wether option is set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_int_range

public int get_option_int_range(java.lang.String optionName,
                                int defaultValue,
                                int lowerBound,
                                int upperBound,
                                java.lang.String optionHelp,
                                boolean nuisance)
Returns the value of an integer option of the specified name between the given bounds.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
lowerBound - The lower bound for possible option values.
upperBound - The upper bound for possible values.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_int_range

public int get_option_int_range(java.lang.String optionName,
                                int defaultValue,
                                int lowerBound,
                                int upperBound,
                                java.lang.String optionHelp)
Returns the value of an integer option of the specified name between the given bounds.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
lowerBound - The lower bound for possible option values.
upperBound - The upper bound for possible values.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_int_range

public int get_option_int_range(java.lang.String optionName,
                                int defaultValue,
                                int lowerBound,
                                int upperBound)
Returns the value of an integer option of the specified name between the given bounds.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
lowerBound - The lower bound for possible option values.
upperBound - The upper bound for possible values.
Returns:
The value for the requested option.

get_option_int_range

public int get_option_int_range(java.lang.String optionName,
                                int lowerBound,
                                int upperBound,
                                java.lang.String optionHelp,
                                boolean nuisance)
Returns the value of an integer option of the specified name between the given bounds.
Parameters:
optionName - The name of the option for which a value is requested.
lowerBound - The lower bound for possible option values.
upperBound - The upper bound for possible values.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName,
                              double defaultValue,
                              java.lang.String optionHelp,
                              boolean nuisance,
                              boolean noPrompt)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
noPrompt - TRUE if prompting always occurs regardless of wether option is set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName,
                              double defaultValue,
                              java.lang.String optionHelp,
                              boolean nuisance)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName,
                              double defaultValue,
                              java.lang.String optionHelp)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName,
                              double defaultValue)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
defaultValue - The default value for the option if it is not found in the option file.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName,
                              java.lang.String optionHelp,
                              boolean nuisance)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
optionHelp - Help display string for using this option.
nuisance - TRUE if prompting is required when option is not set, FALSE otherwise.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName,
                              java.lang.String optionHelp)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
optionHelp - Help display string for using this option.
Returns:
The value for the requested option.

get_option_real

public double get_option_real(java.lang.String optionName)
Returns the value of an double option of the specified name.
Parameters:
optionName - The name of the option for which a value is requested.
Returns:
The value for the requested option.