/lib/JSAP/doc/javadoc/com/martiansoftware/jsap/SimpleJSAP.html
https://bitbucket.org/arkban/somersault · HTML · 454 lines · 378 code · 51 blank · 25 comment · 0 complexity · 6c88f4cd8a32dc4f6d011ae68875dc77 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.4.2_08) on Thu Aug 03 20:30:43 EDT 2006 -->
- <TITLE>
- SimpleJSAP (JSAP: the Java Simple Argument Parser)
- </TITLE>
- <META NAME="keywords" CONTENT="com.martiansoftware.jsap.SimpleJSAP class">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
- <SCRIPT type="text/javascript">
- function windowTitle()
- {
- parent.document.title="SimpleJSAP (JSAP: the Java Simple Argument Parser)";
- }
- </SCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" onload="windowTitle();">
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../com/martiansoftware/jsap/QualifiedSwitch.html" title="class in com.martiansoftware.jsap"><B>PREV CLASS</B></A>
- <A HREF="../../../com/martiansoftware/jsap/StringParser.html" title="class in com.martiansoftware.jsap"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
- <A HREF="SimpleJSAP.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_com.martiansoftware.jsap.JSAP">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- com.martiansoftware.jsap</FONT>
- <BR>
- Class SimpleJSAP</H2>
- <PRE>
- <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
- <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">com.martiansoftware.jsap.JSAP</A>
- <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>com.martiansoftware.jsap.SimpleJSAP</B>
- </PRE>
- <HR>
- <DL>
- <DT>public class <B>SimpleJSAP</B><DT>extends <A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></DL>
- <P>
- A simple interface to <A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap"><CODE>JSAP</CODE></A> that handles directly help,
- explanation and an array of parameters.
-
- <P>More precisely, instances of this class behave exactly like those of
- <A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap"><CODE>JSAP</CODE></A>, but additionally require a command name, an explanation
- (a wordy description) and an array of parameters (which will be registered automatically).
- A switch activated by <samp>--help</samp> is always
- registered under the ID <samp>help</samp>.
-
- <p>A message will be automatically printed upon invocation
- of the <code>parse()</code> methods if an error occurs, or if the help switch is detected. In this
- case, <A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#messagePrinted()"><CODE>messagePrinted()</CODE></A> will return true, and the caller may check this condition
- to stop its actions.
-
- <P>The screen width used to format the help text may be set using <A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#setScreenWidth(int)"><CODE>setScreenWidth(int)</CODE></A>.
- The formatter will preserve newlines.
- <i>Note: as of 2.0a non-breaking spaces are temporarily disabled until some console encoding
- issues have been worked out. - ML</i>
- <P>
- <P>
- <DL>
- <DT><B>Author:</B></DT>
- <DD>Sebastiano Vigna</DD>
- </DL>
- <HR>
- <P>
- <!-- ======== NESTED CLASS SUMMARY ======== -->
- <!-- =========== FIELD SUMMARY =========== -->
- <A NAME="field_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TD COLSPAN=2><FONT SIZE="+2">
- <B>Field Summary</B></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="fields_inherited_from_class_com.martiansoftware.jsap.JSAP"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TD><B>Fields inherited from class com.martiansoftware.jsap.<A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></B></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html#BIGDECIMAL_PARSER">BIGDECIMAL_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#BIGINTEGER_PARSER">BIGINTEGER_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#BOOLEAN_PARSER">BOOLEAN_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#BYTE_PARSER">BYTE_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#CHARACTER_PARSER">CHARACTER_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#CLASS_PARSER">CLASS_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#COLOR_PARSER">COLOR_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#DEFAULT_LISTSEPARATOR">DEFAULT_LISTSEPARATOR</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#DEFAULT_PARAM_HELP_SEPARATOR">DEFAULT_PARAM_HELP_SEPARATOR</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#DEFAULT_SCREENWIDTH">DEFAULT_SCREENWIDTH</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#DOUBLE_PARSER">DOUBLE_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#FLOAT_PARSER">FLOAT_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#GREEDY">GREEDY</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#INETADDRESS_PARSER">INETADDRESS_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#INTEGER_PARSER">INTEGER_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#INTSIZE_PARSER">INTSIZE_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#LIST">LIST</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#LONG_PARSER">LONG_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#LONGSIZE_PARSER">LONGSIZE_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#MULTIPLEDECLARATIONS">MULTIPLEDECLARATIONS</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NO_DEFAULT">NO_DEFAULT</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NO_HELP">NO_HELP</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NO_LONGFLAG">NO_LONGFLAG</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NO_MULTIPLEDECLARATIONS">NO_MULTIPLEDECLARATIONS</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NO_SHORTFLAG">NO_SHORTFLAG</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NOT_GREEDY">NOT_GREEDY</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NOT_LIST">NOT_LIST</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#NOT_REQUIRED">NOT_REQUIRED</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#PACKAGE_PARSER">PACKAGE_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#REQUIRED">REQUIRED</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#SHORT_PARSER">SHORT_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#STRING_PARSER">STRING_PARSER</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#URL_PARSER">URL_PARSER</A></CODE></TD>
- </TR>
- </TABLE>
-
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <A NAME="constructor_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TD COLSPAN=2><FONT SIZE="+2">
- <B>Constructor Summary</B></FONT></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#SimpleJSAP(java.lang.String)">SimpleJSAP</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name)</CODE>
- <BR>
- Creates a new simple JSAP with a help switch, no explanation and default screen width.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#SimpleJSAP(java.lang.String, java.lang.String)">SimpleJSAP</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name,
- <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> explanation)</CODE>
- <BR>
- Creates a new simple JSAP with default screen width.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#SimpleJSAP(java.lang.String, java.lang.String, com.martiansoftware.jsap.Parameter[])">SimpleJSAP</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name,
- <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> explanation,
- <A HREF="../../../com/martiansoftware/jsap/Parameter.html" title="class in com.martiansoftware.jsap">Parameter</A>[] parameter)</CODE>
- <BR>
- Creates a new simple JSAP with default screen width.</TD>
- </TR>
- </TABLE>
-
- <!-- ========== METHOD SUMMARY =========== -->
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TD COLSPAN=2><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#getScreenWidth()">getScreenWidth</A></B>()</CODE>
- <BR>
- Returns the current screen width.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#messagePrinted()">messagePrinted</A></B>()</CODE>
- <BR>
- Returns true if the last parsing caused the a message to be printed.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../com/martiansoftware/jsap/JSAPResult.html" title="class in com.martiansoftware.jsap">JSAPResult</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#parse(java.lang.String)">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> arg)</CODE>
- <BR>
- Parses the specified command line.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../com/martiansoftware/jsap/JSAPResult.html" title="class in com.martiansoftware.jsap">JSAPResult</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#parse(java.lang.String[])">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] arg)</CODE>
- <BR>
- Parses the specified command line array.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html" title="class in com.martiansoftware.jsap">SimpleJSAP</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#setScreenWidth(int)">setScreenWidth</A></B>(int screenWidth)</CODE>
- <BR>
- Sets the screen width.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_com.martiansoftware.jsap.JSAP"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TD><B>Methods inherited from class com.martiansoftware.jsap.<A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></B></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html#finalize()">finalize</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getByID(java.lang.String)">getByID</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getByLongFlag(java.lang.String)">getByLongFlag</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getByShortFlag(char)">getByShortFlag</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getByShortFlag(java.lang.Character)">getByShortFlag</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getHelp()">getHelp</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getHelp(int)">getHelp</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getHelp(int, java.lang.String)">getHelp</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getIDMap()">getIDMap</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getUnflaggedOptionsIterator()">getUnflaggedOptionsIterator</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getUsage()">getUsage</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#registerDefaultSource(com.martiansoftware.jsap.DefaultSource)">registerDefaultSource</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#registerParameter(com.martiansoftware.jsap.Parameter)">registerParameter</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#setHelp(java.lang.String)">setHelp</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#setUsage(java.lang.String)">setUsage</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#toString()">toString</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#unregisterDefaultSource(com.martiansoftware.jsap.DefaultSource)">unregisterDefaultSource</A>, <A HREF="../../../com/martiansoftware/jsap/JSAP.html#unregisterParameter(com.martiansoftware.jsap.Parameter)">unregisterParameter</A></CODE></TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ============ FIELD DETAIL =========== -->
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <A NAME="constructor_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TD COLSPAN=1><FONT SIZE="+2">
- <B>Constructor Detail</B></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="SimpleJSAP(java.lang.String, java.lang.String, com.martiansoftware.jsap.Parameter[])"><!-- --></A><H3>
- SimpleJSAP</H3>
- <PRE>
- public <B>SimpleJSAP</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name,
- <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> explanation,
- <A HREF="../../../com/martiansoftware/jsap/Parameter.html" title="class in com.martiansoftware.jsap">Parameter</A>[] parameter)
- throws <A HREF="../../../com/martiansoftware/jsap/JSAPException.html" title="class in com.martiansoftware.jsap">JSAPException</A></PRE>
- <DL>
- <DD>Creates a new simple JSAP with default screen width.
- <P>
- <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the command for which help will be printed.<DD><CODE>explanation</CODE> - a wordy explanation of the command, or <code>null</code> for no explanation.<DD><CODE>parameter</CODE> - an array of parameters, which will be registered for you, or <code>null</code>.</DL>
- <HR>
- <A NAME="SimpleJSAP(java.lang.String, java.lang.String)"><!-- --></A><H3>
- SimpleJSAP</H3>
- <PRE>
- public <B>SimpleJSAP</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name,
- <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> explanation)
- throws <A HREF="../../../com/martiansoftware/jsap/JSAPException.html" title="class in com.martiansoftware.jsap">JSAPException</A></PRE>
- <DL>
- <DD>Creates a new simple JSAP with default screen width.
- <P>
- <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the command for which help will be printed.<DD><CODE>explanation</CODE> - a wordy explanation of the command, or <code>null</code> for no explanation.</DL>
- <HR>
- <A NAME="SimpleJSAP(java.lang.String)"><!-- --></A><H3>
- SimpleJSAP</H3>
- <PRE>
- public <B>SimpleJSAP</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name)
- throws <A HREF="../../../com/martiansoftware/jsap/JSAPException.html" title="class in com.martiansoftware.jsap">JSAPException</A></PRE>
- <DL>
- <DD>Creates a new simple JSAP with a help switch, no explanation and default screen width.
- <P>
- <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the command for which help will be printed.</DL>
- <!-- ============ METHOD DETAIL ========== -->
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TD COLSPAN=1><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="parse(java.lang.String)"><!-- --></A><H3>
- parse</H3>
- <PRE>
- public <A HREF="../../../com/martiansoftware/jsap/JSAPResult.html" title="class in com.martiansoftware.jsap">JSAPResult</A> <B>parse</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> arg)</PRE>
- <DL>
- <DD><B>Description copied from class: <CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></CODE></B></DD>
- <DD>Parses the specified command line. The specified command line is first
- parsed into an array, much like the operating system does for the JVM
- prior to calling your application's main class' main() method. If no
- Exception is thrown, the entire command line has been parsed
- successfully, and its results have been successfully instantiated.
- <P>
- <DD><DL>
- <DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html#parse(java.lang.String)">parse</A></CODE> in class <CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></CODE></DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>arg</CODE> - An array of command line arguments to parse. This array
- is typically provided in the application's main class' main() method.
- <DT><B>Returns:</B><DD>a JSAPResult containing the resulting Objects.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="parse(java.lang.String[])"><!-- --></A><H3>
- parse</H3>
- <PRE>
- public <A HREF="../../../com/martiansoftware/jsap/JSAPResult.html" title="class in com.martiansoftware.jsap">JSAPResult</A> <B>parse</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] arg)</PRE>
- <DL>
- <DD><B>Description copied from class: <CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></CODE></B></DD>
- <DD>Parses the specified command line array. If no Exception is thrown, the
- entire command line has been parsed successfully, and its results have
- been successfully instantiated.
- <P>
- <DD><DL>
- <DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html#parse(java.lang.String[])">parse</A></CODE> in class <CODE><A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></CODE></DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>arg</CODE> - An array of command line arguments to parse. This array is
- typically provided in the application's main class' main() method.
- <DT><B>Returns:</B><DD>a JSAPResult containing the resulting Objects.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getScreenWidth()"><!-- --></A><H3>
- getScreenWidth</H3>
- <PRE>
- public int <B>getScreenWidth</B>()</PRE>
- <DL>
- <DD>Returns the current screen width.
-
- <P>This value will be passed to <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getHelp(int)"><CODE>JSAP.getHelp(int)</CODE></A>, and used
- to format the explanation.
- <P>
- <DD><DL>
- <DT><B>Returns:</B><DD>the current screen width.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="setScreenWidth(int)"><!-- --></A><H3>
- setScreenWidth</H3>
- <PRE>
- public <A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html" title="class in com.martiansoftware.jsap">SimpleJSAP</A> <B>setScreenWidth</B>(int screenWidth)</PRE>
- <DL>
- <DD>Sets the screen width.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>screenWidth</CODE> - the new screen width.
- <DT><B>Returns:</B><DD>this simple JSAP.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="messagePrinted()"><!-- --></A><H3>
- messagePrinted</H3>
- <PRE>
- public boolean <B>messagePrinted</B>()</PRE>
- <DL>
- <DD>Returns true if the last parsing caused the a message to be printed.
- <P>
- <DD><DL>
- <DT><B>Returns:</B><DD>true if the last parsing caused a message to be printed.</DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../com/martiansoftware/jsap/QualifiedSwitch.html" title="class in com.martiansoftware.jsap"><B>PREV CLASS</B></A>
- <A HREF="../../../com/martiansoftware/jsap/StringParser.html" title="class in com.martiansoftware.jsap"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
- <A HREF="SimpleJSAP.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_com.martiansoftware.jsap.JSAP">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- Copyright © 2002-2006, Martian Software, Inc.. All Rights Reserved.<br>For the latest version and documentation, please visit <a href='http://www.martiansoftware.com/jsap'>http://www.martiansoftware.com/jsap</a>
- </BODY>
- </HTML>