/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

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.4.2_08) on Thu Aug 03 20:30:43 EDT 2006 -->
  6. <TITLE>
  7. SimpleJSAP (JSAP: the Java Simple Argument Parser)
  8. </TITLE>
  9. <META NAME="keywords" CONTENT="com.martiansoftware.jsap.SimpleJSAP class">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. parent.document.title="SimpleJSAP (JSAP: the Java Simple Argument Parser)";
  15. }
  16. </SCRIPT>
  17. </HEAD>
  18. <BODY BGCOLOR="white" onload="windowTitle();">
  19. <!-- ========= START OF TOP NAVBAR ======= -->
  20. <A NAME="navbar_top"><!-- --></A>
  21. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  22. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  23. <TR>
  24. <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  25. <A NAME="navbar_top_firstrow"><!-- --></A>
  26. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  27. <TR ALIGN="center" VALIGN="top">
  28. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  29. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  30. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  31. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  32. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  35. </TR>
  36. </TABLE>
  37. </TD>
  38. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  39. </EM>
  40. </TD>
  41. </TR>
  42. <TR>
  43. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  44. &nbsp;<A HREF="../../../com/martiansoftware/jsap/QualifiedSwitch.html" title="class in com.martiansoftware.jsap"><B>PREV CLASS</B></A>&nbsp;
  45. &nbsp;<A HREF="../../../com/martiansoftware/jsap/StringParser.html" title="class in com.martiansoftware.jsap"><B>NEXT CLASS</B></A></FONT></TD>
  46. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  47. <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
  48. &nbsp;<A HREF="SimpleJSAP.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  49. &nbsp;<SCRIPT type="text/javascript">
  50. <!--
  51. if(window==top) {
  52. document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  53. }
  54. //-->
  55. </SCRIPT>
  56. <NOSCRIPT>
  57. <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  58. </NOSCRIPT>
  59. </FONT></TD>
  60. </TR>
  61. <TR>
  62. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  63. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_com.martiansoftware.jsap.JSAP">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  64. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  65. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  66. </TR>
  67. </TABLE>
  68. <A NAME="skip-navbar_top"></A>
  69. <!-- ========= END OF TOP NAVBAR ========= -->
  70. <HR>
  71. <!-- ======== START OF CLASS DATA ======== -->
  72. <H2>
  73. <FONT SIZE="-1">
  74. com.martiansoftware.jsap</FONT>
  75. <BR>
  76. Class SimpleJSAP</H2>
  77. <PRE>
  78. <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>
  79. <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>
  80. <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>com.martiansoftware.jsap.SimpleJSAP</B>
  81. </PRE>
  82. <HR>
  83. <DL>
  84. <DT>public class <B>SimpleJSAP</B><DT>extends <A HREF="../../../com/martiansoftware/jsap/JSAP.html" title="class in com.martiansoftware.jsap">JSAP</A></DL>
  85. <P>
  86. 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,
  87. explanation and an array of parameters.
  88. <P>More precisely, instances of this class behave exactly like those of
  89. <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
  90. (a wordy description) and an array of parameters (which will be registered automatically).
  91. A switch activated by <samp>--help</samp> is always
  92. registered under the ID <samp>help</samp>.
  93. <p>A message will be automatically printed upon invocation
  94. of the <code>parse()</code> methods if an error occurs, or if the help switch is detected. In this
  95. case, <A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#messagePrinted()"><CODE>messagePrinted()</CODE></A> will return true, and the caller may check this condition
  96. to stop its actions.
  97. <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>.
  98. The formatter will preserve newlines.
  99. <i>Note: as of 2.0a non-breaking spaces are temporarily disabled until some console encoding
  100. issues have been worked out. - ML</i>
  101. <P>
  102. <P>
  103. <DL>
  104. <DT><B>Author:</B></DT>
  105. <DD>Sebastiano Vigna</DD>
  106. </DL>
  107. <HR>
  108. <P>
  109. <!-- ======== NESTED CLASS SUMMARY ======== -->
  110. <!-- =========== FIELD SUMMARY =========== -->
  111. <A NAME="field_summary"><!-- --></A>
  112. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  113. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  114. <TD COLSPAN=2><FONT SIZE="+2">
  115. <B>Field Summary</B></FONT></TD>
  116. </TR>
  117. </TABLE>
  118. &nbsp;<A NAME="fields_inherited_from_class_com.martiansoftware.jsap.JSAP"><!-- --></A>
  119. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  120. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  121. <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>
  122. </TR>
  123. <TR BGCOLOR="white" CLASS="TableRowColor">
  124. <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>
  125. </TR>
  126. </TABLE>
  127. &nbsp;
  128. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  129. <A NAME="constructor_summary"><!-- --></A>
  130. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  131. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  132. <TD COLSPAN=2><FONT SIZE="+2">
  133. <B>Constructor Summary</B></FONT></TD>
  134. </TR>
  135. <TR BGCOLOR="white" CLASS="TableRowColor">
  136. <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>&nbsp;name)</CODE>
  137. <BR>
  138. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new simple JSAP with a help switch, no explanation and default screen width.</TD>
  139. </TR>
  140. <TR BGCOLOR="white" CLASS="TableRowColor">
  141. <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>&nbsp;name,
  142. <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;explanation)</CODE>
  143. <BR>
  144. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new simple JSAP with default screen width.</TD>
  145. </TR>
  146. <TR BGCOLOR="white" CLASS="TableRowColor">
  147. <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>&nbsp;name,
  148. <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;explanation,
  149. <A HREF="../../../com/martiansoftware/jsap/Parameter.html" title="class in com.martiansoftware.jsap">Parameter</A>[]&nbsp;parameter)</CODE>
  150. <BR>
  151. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new simple JSAP with default screen width.</TD>
  152. </TR>
  153. </TABLE>
  154. &nbsp;
  155. <!-- ========== METHOD SUMMARY =========== -->
  156. <A NAME="method_summary"><!-- --></A>
  157. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  158. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  159. <TD COLSPAN=2><FONT SIZE="+2">
  160. <B>Method Summary</B></FONT></TD>
  161. </TR>
  162. <TR BGCOLOR="white" CLASS="TableRowColor">
  163. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  164. <CODE>&nbsp;int</CODE></FONT></TD>
  165. <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#getScreenWidth()">getScreenWidth</A></B>()</CODE>
  166. <BR>
  167. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current screen width.</TD>
  168. </TR>
  169. <TR BGCOLOR="white" CLASS="TableRowColor">
  170. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  171. <CODE>&nbsp;boolean</CODE></FONT></TD>
  172. <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#messagePrinted()">messagePrinted</A></B>()</CODE>
  173. <BR>
  174. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the last parsing caused the a message to be printed.</TD>
  175. </TR>
  176. <TR BGCOLOR="white" CLASS="TableRowColor">
  177. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  178. <CODE>&nbsp;<A HREF="../../../com/martiansoftware/jsap/JSAPResult.html" title="class in com.martiansoftware.jsap">JSAPResult</A></CODE></FONT></TD>
  179. <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>&nbsp;arg)</CODE>
  180. <BR>
  181. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses the specified command line.</TD>
  182. </TR>
  183. <TR BGCOLOR="white" CLASS="TableRowColor">
  184. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  185. <CODE>&nbsp;<A HREF="../../../com/martiansoftware/jsap/JSAPResult.html" title="class in com.martiansoftware.jsap">JSAPResult</A></CODE></FONT></TD>
  186. <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>[]&nbsp;arg)</CODE>
  187. <BR>
  188. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses the specified command line array.</TD>
  189. </TR>
  190. <TR BGCOLOR="white" CLASS="TableRowColor">
  191. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  192. <CODE>&nbsp;<A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html" title="class in com.martiansoftware.jsap">SimpleJSAP</A></CODE></FONT></TD>
  193. <TD><CODE><B><A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html#setScreenWidth(int)">setScreenWidth</A></B>(int&nbsp;screenWidth)</CODE>
  194. <BR>
  195. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the screen width.</TD>
  196. </TR>
  197. </TABLE>
  198. &nbsp;<A NAME="methods_inherited_from_class_com.martiansoftware.jsap.JSAP"><!-- --></A>
  199. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  200. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  201. <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>
  202. </TR>
  203. <TR BGCOLOR="white" CLASS="TableRowColor">
  204. <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>
  205. </TR>
  206. </TABLE>
  207. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  208. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  209. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  210. <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>
  211. </TR>
  212. <TR BGCOLOR="white" CLASS="TableRowColor">
  213. <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>
  214. </TR>
  215. </TABLE>
  216. &nbsp;
  217. <P>
  218. <!-- ============ FIELD DETAIL =========== -->
  219. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  220. <A NAME="constructor_detail"><!-- --></A>
  221. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  222. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  223. <TD COLSPAN=1><FONT SIZE="+2">
  224. <B>Constructor Detail</B></FONT></TD>
  225. </TR>
  226. </TABLE>
  227. <A NAME="SimpleJSAP(java.lang.String, java.lang.String, com.martiansoftware.jsap.Parameter[])"><!-- --></A><H3>
  228. SimpleJSAP</H3>
  229. <PRE>
  230. 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>&nbsp;name,
  231. <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;explanation,
  232. <A HREF="../../../com/martiansoftware/jsap/Parameter.html" title="class in com.martiansoftware.jsap">Parameter</A>[]&nbsp;parameter)
  233. throws <A HREF="../../../com/martiansoftware/jsap/JSAPException.html" title="class in com.martiansoftware.jsap">JSAPException</A></PRE>
  234. <DL>
  235. <DD>Creates a new simple JSAP with default screen width.
  236. <P>
  237. <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>
  238. <HR>
  239. <A NAME="SimpleJSAP(java.lang.String, java.lang.String)"><!-- --></A><H3>
  240. SimpleJSAP</H3>
  241. <PRE>
  242. 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>&nbsp;name,
  243. <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;explanation)
  244. throws <A HREF="../../../com/martiansoftware/jsap/JSAPException.html" title="class in com.martiansoftware.jsap">JSAPException</A></PRE>
  245. <DL>
  246. <DD>Creates a new simple JSAP with default screen width.
  247. <P>
  248. <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>
  249. <HR>
  250. <A NAME="SimpleJSAP(java.lang.String)"><!-- --></A><H3>
  251. SimpleJSAP</H3>
  252. <PRE>
  253. 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>&nbsp;name)
  254. throws <A HREF="../../../com/martiansoftware/jsap/JSAPException.html" title="class in com.martiansoftware.jsap">JSAPException</A></PRE>
  255. <DL>
  256. <DD>Creates a new simple JSAP with a help switch, no explanation and default screen width.
  257. <P>
  258. <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the command for which help will be printed.</DL>
  259. <!-- ============ METHOD DETAIL ========== -->
  260. <A NAME="method_detail"><!-- --></A>
  261. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  262. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  263. <TD COLSPAN=1><FONT SIZE="+2">
  264. <B>Method Detail</B></FONT></TD>
  265. </TR>
  266. </TABLE>
  267. <A NAME="parse(java.lang.String)"><!-- --></A><H3>
  268. parse</H3>
  269. <PRE>
  270. 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>&nbsp;arg)</PRE>
  271. <DL>
  272. <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>
  273. <DD>Parses the specified command line. The specified command line is first
  274. parsed into an array, much like the operating system does for the JVM
  275. prior to calling your application's main class' main() method. If no
  276. Exception is thrown, the entire command line has been parsed
  277. successfully, and its results have been successfully instantiated.
  278. <P>
  279. <DD><DL>
  280. <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>
  281. </DD>
  282. <DD><DL>
  283. <DT><B>Parameters:</B><DD><CODE>arg</CODE> - An array of command line arguments to parse. This array
  284. is typically provided in the application's main class' main() method.
  285. <DT><B>Returns:</B><DD>a JSAPResult containing the resulting Objects.</DL>
  286. </DD>
  287. </DL>
  288. <HR>
  289. <A NAME="parse(java.lang.String[])"><!-- --></A><H3>
  290. parse</H3>
  291. <PRE>
  292. 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>[]&nbsp;arg)</PRE>
  293. <DL>
  294. <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>
  295. <DD>Parses the specified command line array. If no Exception is thrown, the
  296. entire command line has been parsed successfully, and its results have
  297. been successfully instantiated.
  298. <P>
  299. <DD><DL>
  300. <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>
  301. </DD>
  302. <DD><DL>
  303. <DT><B>Parameters:</B><DD><CODE>arg</CODE> - An array of command line arguments to parse. This array is
  304. typically provided in the application's main class' main() method.
  305. <DT><B>Returns:</B><DD>a JSAPResult containing the resulting Objects.</DL>
  306. </DD>
  307. </DL>
  308. <HR>
  309. <A NAME="getScreenWidth()"><!-- --></A><H3>
  310. getScreenWidth</H3>
  311. <PRE>
  312. public int <B>getScreenWidth</B>()</PRE>
  313. <DL>
  314. <DD>Returns the current screen width.
  315. <P>This value will be passed to <A HREF="../../../com/martiansoftware/jsap/JSAP.html#getHelp(int)"><CODE>JSAP.getHelp(int)</CODE></A>, and used
  316. to format the explanation.
  317. <P>
  318. <DD><DL>
  319. <DT><B>Returns:</B><DD>the current screen width.</DL>
  320. </DD>
  321. </DL>
  322. <HR>
  323. <A NAME="setScreenWidth(int)"><!-- --></A><H3>
  324. setScreenWidth</H3>
  325. <PRE>
  326. public <A HREF="../../../com/martiansoftware/jsap/SimpleJSAP.html" title="class in com.martiansoftware.jsap">SimpleJSAP</A> <B>setScreenWidth</B>(int&nbsp;screenWidth)</PRE>
  327. <DL>
  328. <DD>Sets the screen width.
  329. <P>
  330. <DD><DL>
  331. <DT><B>Parameters:</B><DD><CODE>screenWidth</CODE> - the new screen width.
  332. <DT><B>Returns:</B><DD>this simple JSAP.</DL>
  333. </DD>
  334. </DL>
  335. <HR>
  336. <A NAME="messagePrinted()"><!-- --></A><H3>
  337. messagePrinted</H3>
  338. <PRE>
  339. public boolean <B>messagePrinted</B>()</PRE>
  340. <DL>
  341. <DD>Returns true if the last parsing caused the a message to be printed.
  342. <P>
  343. <DD><DL>
  344. <DT><B>Returns:</B><DD>true if the last parsing caused a message to be printed.</DL>
  345. </DD>
  346. </DL>
  347. <!-- ========= END OF CLASS DATA ========= -->
  348. <HR>
  349. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  350. <A NAME="navbar_bottom"><!-- --></A>
  351. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  352. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  353. <TR>
  354. <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  355. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  356. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  357. <TR ALIGN="center" VALIGN="top">
  358. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  359. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  360. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  361. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  362. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  363. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  364. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  365. </TR>
  366. </TABLE>
  367. </TD>
  368. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  369. </EM>
  370. </TD>
  371. </TR>
  372. <TR>
  373. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  374. &nbsp;<A HREF="../../../com/martiansoftware/jsap/QualifiedSwitch.html" title="class in com.martiansoftware.jsap"><B>PREV CLASS</B></A>&nbsp;
  375. &nbsp;<A HREF="../../../com/martiansoftware/jsap/StringParser.html" title="class in com.martiansoftware.jsap"><B>NEXT CLASS</B></A></FONT></TD>
  376. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  377. <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
  378. &nbsp;<A HREF="SimpleJSAP.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  379. &nbsp;<SCRIPT type="text/javascript">
  380. <!--
  381. if(window==top) {
  382. document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  383. }
  384. //-->
  385. </SCRIPT>
  386. <NOSCRIPT>
  387. <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  388. </NOSCRIPT>
  389. </FONT></TD>
  390. </TR>
  391. <TR>
  392. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  393. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_com.martiansoftware.jsap.JSAP">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  394. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  395. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  396. </TR>
  397. </TABLE>
  398. <A NAME="skip-navbar_bottom"></A>
  399. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  400. <HR>
  401. Copyright &copy; 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>
  402. </BODY>
  403. </HTML>