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