<h2>org.das2.util.ArgumentList</h2><p>Utility class for processing the String[] arguments passed into the main routine,
 handing positional and switch parameters.  Also automatically generates the
 usage documentation.

 Note in Autoplot's pngwalk, we add a parameter and positional argument with the
 same name.  This should continue to be supported.</p>
<h2>ArgumentList( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> programName )</h2>
<p>creates the processor for the program.  <tt>programName</tt> is provided
 for the usage statement.  After creating the object, arguments are
 specified one by one, and then the process method is called.</p>

<hr>
<a name="FALSE"></a>
<h2>FALSE</h2>
<p></p>

<hr>
<a name="TRUE"></a>
<h2>TRUE</h2>
<p></p>

<hr>
<a name="addBooleanSwitchArgument-java.lang.String-java.lang.String-java.lang.String-java.lang.String"></a>
<h2>addBooleanSwitchArgument</h2>
addBooleanSwitchArgument( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> name, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> abbrev, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> description ) &rarr; void

<p>specify a named switch argument that is named, and we only care whether it was used or not.  e.g. --debug</p>

<h3>Parameters</h3>
name - the long parameter name, which the user may enter. e.g. "level"
<br>
abbrev - short (one letter) parameter version.  e.g. "l" for -l=3
<br>
key - the internal reference name to get the value specified, not necessarily but often the same as name.
<br>
description - a short (40 character) description of the argument.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=addBooleanSwitchArgument&unscoped_q=addBooleanSwitchArgument">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#addBooleanSwitchArgument-java.lang.String-java.lang.String-java.lang.String-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L282">[view source]</a>
<br>
<br>
<hr>
<a name="addOptionalPositionArgument-int-java.lang.String-java.lang.String-java.lang.String"></a>
<h2>addOptionalPositionArgument</h2>
addOptionalPositionArgument( int position, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> defaultValue, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> description ) &rarr; void

<p>Specify the ith positional argument, which may be left unspecified by
 the user.  Note that all positional arguments after this one must also be
 optional.</p>

<h3>Parameters</h3>
position - the position number, 0 is the first argument position after the class name.
<br>
key - the internal reference name to get the value specified.
<br>
defaultValue - the value that is returned if a value is not provided by the user.
<br>
description - a short (40 character) description of the argument.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=addOptionalPositionArgument&unscoped_q=addOptionalPositionArgument">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#addOptionalPositionArgument-int-java.lang.String-java.lang.String-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L222">[view source]</a>
<br>
<br>
<hr>
<a name="addOptionalSwitchArgument-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String"></a>
<h2>addOptionalSwitchArgument</h2>
addOptionalSwitchArgument( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> name, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> abbrev, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> defaultValue, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> description ) &rarr; void

<p>specify a named switch argument that may be specified by the user.  For example, --level=3 or -l=3</p>

<h3>Parameters</h3>
name - the long parameter name, which the user may enter. e.g. "level"
<br>
abbrev - short (one letter) parameter version.  e.g. "l" for -l=3
<br>
key - the internal reference name to get the value specified, not necessarily but often the same as name.
<br>
defaultValue - value to return if the user doesn't specify.  If TRUE or FALSE is used, then the
     user may use a number of different inputs such as "T" or "true", and getBooleanValue can be used to read the value
<br>
description - a short (40 character) description of the argument.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=addOptionalSwitchArgument&unscoped_q=addOptionalSwitchArgument">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#addOptionalSwitchArgument-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L266">[view source]</a>
<br>
<br>
<hr>
<a name="addPositionArgument-int-java.lang.String-java.lang.String"></a>
<h2>addPositionArgument</h2>
addPositionArgument( int position, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> description ) &rarr; void

<p>Specify the ith positional argument.</p>

<h3>Parameters</h3>
position - the position number, 0 is the first argument position after the class name.
<br>
key - the internal reference name to get the value specified.
<br>
description - a short (40 character) description of the argument.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=addPositionArgument&unscoped_q=addPositionArgument">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#addPositionArgument-int-java.lang.String-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L190">[view source]</a>
<br>
<br>
<hr>
<a name="addSwitchArgument-java.lang.String-java.lang.String-java.lang.String-java.lang.String"></a>
<h2>addSwitchArgument</h2>
addSwitchArgument( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> name, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> abbrev, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> description ) &rarr; void

<p>specify a named switch argument that must be specified by the user.  For example, --level=3 or -l=3</p>

<h3>Parameters</h3>
name - the long parameter name, which the user may enter. e.g. "level"
<br>
abbrev - short (one letter) parameter version.  e.g. "l" for -l=3
<br>
key - the internal reference name to get the value specified, not necessarily but often the same as name.
<br>
description - a short (40 character) description of the argument.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=addSwitchArgument&unscoped_q=addSwitchArgument">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#addSwitchArgument-java.lang.String-java.lang.String-java.lang.String-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L238">[view source]</a>
<br>
<br>
<hr>
<a name="getBooleanValue-java.lang.String"></a>
<h2>getBooleanValue</h2>
getBooleanValue( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key ) &rarr; boolean

<p></p>

<h3>Parameters</h3>
key - a String

<h3>Returns:</h3>
boolean

<br><br>
<a href="https://github.com/autoplot/dev/search?q=getBooleanValue&unscoped_q=getBooleanValue">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#getBooleanValue-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L175">[view source]</a>
<br>
<br>
<hr>
<a name="getExitCode"></a>
<h2>getExitCode</h2>
getExitCode(  ) &rarr; int

<p>return 0 if the exit code for a checkArgs()==false is 0 or non-zero.
 It will be 0 if --help was used.</p>

<h3>Returns:</h3>
the exit code.
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getExitCode&unscoped_q=getExitCode">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#getExitCode">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L380">[view source]</a>
<br>
<br>
<hr>
<a name="getMap"></a>
<h2>getMap</h2>
getMap(  ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/util/Map.html'>java.util.Map</a>

<p>return a Map of all the specified values.  The keys are all the internal
 String keys, and the values are all Strings.</p>

<h3>Returns:</h3>
a Map of the specified values, including defaults.
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getMap&unscoped_q=getMap">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#getMap">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L463">[view source]</a>
<br>
<br>
<hr>
<a name="getOptions"></a>
<h2>getOptions</h2>
getOptions(  ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/util/Map.html'>java.util.Map</a>

<p>returns a Map of optional arguments that were specified, so you can see
 exactly what was specified.</p>

<h3>Returns:</h3>
a Map of the specified values, without defaults.
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getOptions&unscoped_q=getOptions">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#getOptions">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L472">[view source]</a>
<br>
<br>
<hr>
<a name="getPreferences"></a>
<h2>getPreferences</h2>
getPreferences(  ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/util/prefs/Preferences.html'>java.util.prefs.Preferences</a>

<p>returns the options as a java.util.prefs.Preferences object, for
 batch processes.  The idea is that a process which grabs default
 settings from the user Preferences can instead get them from the command
 line, to support batch processes.  See the Vg1pws app for an example of
 how this is used.</p>

<h3>Returns:</h3>
a Preferences object, loaded with the command line values.
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getPreferences&unscoped_q=getPreferences">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#getPreferences">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L122">[view source]</a>
<br>
<br>
<hr>
<a name="getValue-java.lang.String"></a>
<h2>getValue</h2>
getValue( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> key ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a>

<p>get the value for this parameter</p>

<h3>Parameters</h3>
key - the argument identifier.

<h3>Returns:</h3>
the parameter's value.
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getValue&unscoped_q=getValue">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#getValue-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L85">[view source]</a>
<br>
<br>
<hr>
<a name="logPrefsSettings-java.util.logging.Logger"></a>
<h2>logPrefsSettings</h2>
logPrefsSettings( <a href='https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html'>java.util.logging.Logger</a> logger ) &rarr; void

<p>dump the configuration to the given logger at Level.CONFIG.</p>

<h3>Parameters</h3>
logger - a Logger

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=logPrefsSettings&unscoped_q=logPrefsSettings">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#logPrefsSettings-java.util.logging.Logger">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L635">[view source]</a>
<br>
<br>
<hr>
<a name="makeFileReferenceAbsolute-java.lang.String"></a>
<h2>makeFileReferenceAbsolute</h2>
makeFileReferenceAbsolute( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> ref ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a>

<p>make a standard way to make file names absolute</p>

<h3>Parameters</h3>
ref - e.g. files/afile/foo.txt

<h3>Returns:</h3>
/home/jbf/data/files/afile/foo.txt because PWD is /home/jbf/data
<br><br>
<a href="https://github.com/autoplot/dev/search?q=makeFileReferenceAbsolute&unscoped_q=makeFileReferenceAbsolute">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#makeFileReferenceAbsolute-java.lang.String">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L98">[view source]</a>
<br>
<br>
<hr>
<a name="printPrefsSettings"></a>
<h2>printPrefsSettings</h2>
printPrefsSettings(  ) &rarr; void

<p>see Vg1pws app for example use.</p>

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=printPrefsSettings&unscoped_q=printPrefsSettings">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#printPrefsSettings">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L592">[view source]</a>
<br>
<br>
<hr>
<a name="printUsage"></a>
<h2>printUsage</h2>
printUsage(  ) &rarr; void

<p>print the usage statement out to stderr.</p>

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=printUsage&unscoped_q=printUsage">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#printUsage">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L290">[view source]</a>
<br>
<br>
<hr>
<a name="process-java.lang.String[]"></a>
<h2>process</h2>
process( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String[]</a> args ) &rarr; boolean

<p>given the specification, process the argument list.  If the list is in error, the
 usage statement is generated, and the System.exit is called (sorry!).  Otherwise
 the method returns and getValue() may be used to retrieve the values.

 Again, note that System.exit may be called.  This is probably a bad idea and another
 method will probably be added that would return true if processing was successful.</p>

<h3>Parameters</h3>
args - as in public static void main( String[] args ).

<h3>Returns:</h3>
false if System.exit should be called.
<br><br>
<a href="https://github.com/autoplot/dev/search?q=process&unscoped_q=process">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#process-java.lang.String[]">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L552">[view source]</a>
<br>
<br>
<hr>
<a name="requireOneOf-java.lang.String[]"></a>
<h2>requireOneOf</h2>
requireOneOf( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String[]</a> keyNames ) &rarr; void

<p>requires the user specify one of these values, otherwise the usage
 statement is printed.</p>

<h3>Parameters</h3>
keyNames - an array of internal key names that identify parameters.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=requireOneOf&unscoped_q=requireOneOf">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/ArgumentList.md">[view on GitHub]</a>
 <a href="https://cottagesystems.com/~jbf/autoplot/doc2018/org/das2/util/ArgumentList.html#requireOneOf-java.lang.String[]">[view on old javadoc]</a>
 <a href="https://github.com/das-developers/das2java/tree/main/dasCoreUtil/src/org/das2/util/ArgumentList.java#L208">[view source]</a>
<br>
<br>