edu.byu.ece.edif.util.jsap
Class JSAPCommandParser

java.lang.Object
  extended by com.martiansoftware.jsap.JSAP
      extended by edu.byu.ece.edif.util.jsap.JSAPCommandParser

public class JSAPCommandParser
extends com.martiansoftware.jsap.JSAP

A JSAP (Java-based Simple Argument Parser) with additional functionality. If the additional functionality provided by this class were added to JSAP itself, this class would be unnecessary. Added functionality includes:

Author:
James Carroll
See Also:
JSAP API, JSAP Homepage, NMRCommandParser, DWCCommandParser, JSAP

Field Summary
protected  java.lang.String _EMAIL_ADDRESS
          "Report bugs to ..."
protected static BoundedDoubleStringParser _minZeroInclusive
          Range := [0,oo], where oo = Double.MAX_VALUE (nearly infinity)
Known uses: desiredUtilizationFactor
protected static BoundedDoubleStringParser _minZeroNonInclusive
          Range := (0,oo]
Known uses: ultilzationExpansionFactor
protected static BoundedIntegerStringParser _oneTwoThree
          Set := {1,2,3}
Known uses: inputAdditionType, outputAdditionType, SCCSortType
protected  java.util.ArrayList<com.martiansoftware.jsap.Parameter> _parameters
          Ordered List of parameters to easily register them all or print them all
protected  com.martiansoftware.jsap.JSAPResult _result
          JSAPResult object used to store the parameters after being parsed.
protected static BoundedIntegerStringParser _zeroOne
          Set := {0,1} Use for hlConst
protected static BoundedDoubleStringParser _zeroToOneIncludeOne
          Range := (0,1]
Known uses: availableSpaceUtilizationFactor
protected static BoundedDoubleStringParser _zeroToOneIncludeZero
          Range := [0,1)
Known uses: none
protected static BoundedDoubleStringParser _zeroToOneInclusive
          Range := [0,1]
Known uses: mergeFactor, optimizationFactor.
static java.lang.String CONF_FILENAME
          Primary configuration file
static java.lang.String ETC_FILENAME
          Secondary configuration file
static java.lang.String FALSE
           
static java.lang.String HELP
           
static java.lang.String INPUT_FILE
           
static char LIST_DELIMITER
          Character used to separate lists
static java.lang.String OUTPUT_FILE
           
static java.lang.String TRUE
           
static java.lang.String USE_CONFIG
           
static java.lang.String VERSION
           
static java.lang.String WRITE_CONFIG
           
 
Fields inherited from class com.martiansoftware.jsap.JSAP
BIGDECIMAL_PARSER, BIGINTEGER_PARSER, BOOLEAN_PARSER, BYTE_PARSER, CHARACTER_PARSER, CLASS_PARSER, COLOR_PARSER, DEFAULT_LISTSEPARATOR, DEFAULT_PARAM_HELP_SEPARATOR, DEFAULT_SCREENWIDTH, DOUBLE_PARSER, FLOAT_PARSER, GREEDY, INETADDRESS_PARSER, INTEGER_PARSER, INTSIZE_PARSER, LIST, LONG_PARSER, LONGSIZE_PARSER, MULTIPLEDECLARATIONS, NO_DEFAULT, NO_HELP, NO_LONGFLAG, NO_MULTIPLEDECLARATIONS, NO_SHORTFLAG, NOT_GREEDY, NOT_LIST, NOT_REQUIRED, PACKAGE_PARSER, REQUIRED, SHORT_PARSER, STRING_PARSER, URL_PARSER
 
Constructor Summary
JSAPCommandParser()
          Create a new NMRCommandParser with the given command-line arguments.
 
Method Summary
protected  void createConfigFile(java.lang.String filename)
          Takes all the user set parameters and writes them to a config file, which can be used later as a default set of parameters.
 com.martiansoftware.jsap.JSAPResult getResult()
           
static void main(java.lang.String[] args)
          For testing purposes only.
 
Methods inherited from class com.martiansoftware.jsap.JSAP
finalize, getByID, getByLongFlag, getByShortFlag, getByShortFlag, getDefaults, getHelp, getHelp, getHelp, getIDMap, getUnflaggedOptionsIterator, getUsage, parse, parse, registerDefaultSource, registerParameter, setHelp, setUsage, toString, unregisterDefaultSource, unregisterParameter
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONF_FILENAME

public static final java.lang.String CONF_FILENAME
Primary configuration file

See Also:
Constant Field Values

_EMAIL_ADDRESS

protected java.lang.String _EMAIL_ADDRESS
"Report bugs to ..."


ETC_FILENAME

public static final java.lang.String ETC_FILENAME
Secondary configuration file

See Also:
Constant Field Values

LIST_DELIMITER

public static final char LIST_DELIMITER
Character used to separate lists

See Also:
Constant Field Values

FALSE

public static final java.lang.String FALSE
See Also:
Constant Field Values

HELP

public static final java.lang.String HELP
See Also:
Constant Field Values

INPUT_FILE

public static final java.lang.String INPUT_FILE
See Also:
Constant Field Values

OUTPUT_FILE

public static final java.lang.String OUTPUT_FILE
See Also:
Constant Field Values

TRUE

public static final java.lang.String TRUE
See Also:
Constant Field Values

USE_CONFIG

public static final java.lang.String USE_CONFIG
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

WRITE_CONFIG

public static final java.lang.String WRITE_CONFIG
See Also:
Constant Field Values

_minZeroInclusive

protected static BoundedDoubleStringParser _minZeroInclusive
Range := [0,oo], where oo = Double.MAX_VALUE (nearly infinity)
Known uses: desiredUtilizationFactor


_minZeroNonInclusive

protected static BoundedDoubleStringParser _minZeroNonInclusive
Range := (0,oo]
Known uses: ultilzationExpansionFactor


_oneTwoThree

protected static BoundedIntegerStringParser _oneTwoThree
Set := {1,2,3}
Known uses: inputAdditionType, outputAdditionType, SCCSortType


_parameters

protected java.util.ArrayList<com.martiansoftware.jsap.Parameter> _parameters
Ordered List of parameters to easily register them all or print them all


_result

protected com.martiansoftware.jsap.JSAPResult _result
JSAPResult object used to store the parameters after being parsed.


_zeroToOneIncludeOne

protected static BoundedDoubleStringParser _zeroToOneIncludeOne
Range := (0,1]
Known uses: availableSpaceUtilizationFactor


_zeroToOneIncludeZero

protected static BoundedDoubleStringParser _zeroToOneIncludeZero
Range := [0,1)
Known uses: none


_zeroToOneInclusive

protected static BoundedDoubleStringParser _zeroToOneInclusive
Range := [0,1]
Known uses: mergeFactor, optimizationFactor.


_zeroOne

protected static BoundedIntegerStringParser _zeroOne
Set := {0,1} Use for hlConst

Constructor Detail

JSAPCommandParser

public JSAPCommandParser()
Create a new NMRCommandParser with the given command-line arguments.

Parameters:
args - The command-line arguments
Method Detail

getResult

public com.martiansoftware.jsap.JSAPResult getResult()
Returns:
The JSAPResult object.

main

public static void main(java.lang.String[] args)
For testing purposes only. Parses the command-line arguments, which ensures that they are valid, and then simply prints a list of all the arguments.

Parameters:
args - Command-line arguments

createConfigFile

protected void createConfigFile(java.lang.String filename)
Takes all the user set parameters and writes them to a config file, which can be used later as a default set of parameters.

Parameters:
filename - The output filename to be written.