Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sun Aug 30 19:36:38 CDT 1998 -->
<title>
  Class gnu.getopt.LongOpt
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-gnu.getopt.html">This Package</a>  <a href="Package-gnu.getopt.html">Previous</a>  <a href="Package-gnu.getopt.html">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class gnu.getopt.LongOpt
</h1>
<pre>
java.lang.Object
   |
   +----gnu.getopt.LongOpt
</pre>
<hr>
<dl>
  <dt> public class <b>LongOpt</b>
  <dt> extends Object
</dl>
This object represents the definition of a long option in the Java port
 of GNU getopt.  An array of LongOpt objects is passed to the Getopt
 object to define the list of valid long options for a given parsing
 session.  Refer to the getopt documentation for details on the
 format of long options.
<p>
<dl>
  <dt> <b>Version:</b>
  <dd> 1.0.3
  <dt> <b>Author:</b>
  <dd> Aaron M. Renn (arenn@urbanophile.com)
    <dt> <b>See Also:</b>
    <dd> <a href="gnu.getopt.Getopt.html#_top_">Getopt</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#NO_ARGUMENT"><b>NO_ARGUMENT</b></a>
  <dd>  Constant value used for the "has_arg" constructor argument.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#OPTIONAL_ARGUMENT"><b>OPTIONAL_ARGUMENT</b></a>
  <dd>  Constant value used for the "has_arg" constructor argument.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#REQUIRED_ARGUMENT"><b>REQUIRED_ARGUMENT</b></a>
  <dd> 
 Constant value used for the "has_arg" constructor argument.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#LongOpt(java.lang.String, int, java.lang.StringBuffer, int)"><b>LongOpt</b></a>(String, int, StringBuffer, int)
  <dd>  Create a new LongOpt object with the given parameter values.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getFlag()"><b>getFlag</b></a>()
  <dd>  Returns the value of the 'flag' field for this long option

 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHasArg()"><b>getHasArg</b></a>()
  <dd>  Returns the value set for the 'has_arg' field for this long option

 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getName()"><b>getName</b></a>()
  <dd>  Returns the name of this LongOpt as a String

 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getVal()"><b>getVal</b></a>()
  <dd>  Returns the value of the 'val' field for this long option

 
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="NO_ARGUMENT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>NO_ARGUMENT</b>
<pre>
 public static final int NO_ARGUMENT
</pre>
<dl>
  <dd> Constant value used for the "has_arg" constructor argument.  This
 value indicates that the option takes no argument.<p>
</dl>
<a name="REQUIRED_ARGUMENT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>REQUIRED_ARGUMENT</b>
<pre>
 public static final int REQUIRED_ARGUMENT
</pre>
<dl>
  <dd> Constant value used for the "has_arg" constructor argument.  This
 value indicates that the option takes an argument that is required.<p>
</dl>
<a name="OPTIONAL_ARGUMENT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>OPTIONAL_ARGUMENT</b>
<pre>
 public static final int OPTIONAL_ARGUMENT
</pre>
<dl>
  <dd> Constant value used for the "has_arg" constructor argument.  This
 value indicates that the option takes an argument that is optional.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="LongOpt"></a>
<a name="LongOpt(java.lang.String, int, java.lang.StringBuffer, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>LongOpt</b>
<pre>
 public LongOpt(String name,
                int has_arg,
                StringBuffer flag,
                int val) throws IllegalArgumentException
</pre>
<dl>
  <dd> Create a new LongOpt object with the given parameter values.  If the
 value passed as has_arg is not valid, then an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - The long option String.
    <dd> has_arg - Indicates whether the option has no argument (NO_ARGUMENT), a required argument (REQUIRED_ARGUMENT) or an optional argument (OPTIONAL_ARGUMENT).
    <dd> flag - If non-null, this is a location to store the value of "val" when this option is encountered, otherwise "val" is treated as the equivalent short option character.
    <dd> val - The value to return for this long option, or the equivalent single letter option to emulate if flag is null.
    <dt> <b>Throws:</b> IllegalArgumentException
    <dd> If the has_arg param is not one of NO_ARGUMENT, REQUIRED_ARGUMENT or OPTIONAL_ARGUMENT.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getName()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getName"><b>getName</b></a>
<pre>
 public String getName()
</pre>
<dl>
  <dd> Returns the name of this LongOpt as a String
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> Then name of the long option
  </dl></dd>
</dl>
<a name="getHasArg()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHasArg"><b>getHasArg</b></a>
<pre>
 public int getHasArg()
</pre>
<dl>
  <dd> Returns the value set for the 'has_arg' field for this long option
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The value of 'has_arg'
  </dl></dd>
</dl>
<a name="getFlag()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getFlag"><b>getFlag</b></a>
<pre>
 public StringBuffer getFlag()
</pre>
<dl>
  <dd> Returns the value of the 'flag' field for this long option
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The value of 'flag'
  </dl></dd>
</dl>
<a name="getVal()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getVal"><b>getVal</b></a>
<pre>
 public int getVal()
</pre>
<dl>
  <dd> Returns the value of the 'val' field for this long option
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The value of 'val'
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-gnu.getopt.html">This Package</a>  <a href="Package-gnu.getopt.html">Previous</a>  <a href="Package-gnu.getopt.html">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
New to GrepCode? Check out our FAQ X