AFLPcore
Class ProgOptions
java.lang.Object
|
+--AFLPcore.ProgOptions
- public class ProgOptions
- extends java.lang.Object
This class contains static methods and variables that provide
several features to the program. It controls most of the options that
the porgram needs. It contains the path that the program is in as well
as the browser that displays the help files. It contains methods to
run the help browser as well as a method to parse the configuration file.
Field Summary |
static java.lang.String |
homePath
This is the path that points to the program directory. |
Method Summary |
static java.lang.String |
nextLine(java.io.BufferedReader inStream)
Gets a line from the specified input stream. |
static void |
readOptions()
Reads in the options form the configuration file. |
static java.lang.String |
retrieve(java.lang.String param)
Gives the value of a parameter specified in the input file. |
static void |
showHelp(java.lang.String helpFile)
This displays the specified helpfile in a web browser. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
homePath
public static java.lang.String homePath
- This is the path that points to the program directory. It's used
so other parts of the program can know where to find things, like
standard definition files, images, or help files.
ProgOptions
public ProgOptions()
showHelp
public static void showHelp(java.lang.String helpFile)
throws java.io.IOException
- This displays the specified helpfile in a web browser. The
browser is defined in the file "genograph.cfg"
- Parameters:
helpFile
- the file name of the help file. It is assumed
that the file is in the "doc" subdirectory.- Throws:
java.io.IOException
- occurs if the browser file or help file
contain an error
readOptions
public static void readOptions()
- Reads in the options form the configuration file. Make sure that this
is called before trying to use program options.
retrieve
public static java.lang.String retrieve(java.lang.String param)
- Gives the value of a parameter specified in the input file.
- Parameters:
param
- the name of the parameter to retrieve, ie BROWSER- Returns:
- the text on the line immediately following the name. It
will be
null
if the parameter was not specified.
nextLine
public static java.lang.String nextLine(java.io.BufferedReader inStream)
throws java.io.IOException
- Gets a line from the specified input stream. It will skip over blank
lines and lines beginning with a '#'. Additionally, white space will
be trimmed from both ends of the string.
- Parameters:
inStream
- the stream to read from- Returns:
- the line that isn't blank or a comment.
null
will be returned if the end of the stream is reached. - Throws:
java.io.IOException
- if an I/O problem occurs.