Class GetOpt.LongOption

java.lang.Object
  extended by GetOpt.LongOption
Enclosing class:
GetOpt

public static class GetOpt.LongOption
extends java.lang.Object

A record used in a table of option descriptions passed to a constructor of GetOpt. For example,

   new LongOption("color", LongOption.REQ_ARG, 'c')
 
describes a an option invoked as "--color=red" equivalent to the short option "-c red".


Field Summary
 int hasArg
          A flag, one of GetOpt.NO_ARG, GetOpt.REQ_ARG, or GetOpt.OPT_ARG.
 java.lang.String name
          The option name (for example, "color").
 char val
          The equivalent short (one-char) option name (for example 'c').
 
Constructor Summary
GetOpt.LongOption(java.lang.String name, int hasArg, char val)
          Create a LongOption from its components.
 
Method Summary
 java.lang.String toString()
          Convert this option into a printable string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The option name (for example, "color").


hasArg

public int hasArg
A flag, one of GetOpt.NO_ARG, GetOpt.REQ_ARG, or GetOpt.OPT_ARG.


val

public char val
The equivalent short (one-char) option name (for example 'c').

Constructor Detail

GetOpt.LongOption

public GetOpt.LongOption(java.lang.String name,
                         int hasArg,
                         char val)
Create a LongOption from its components.

Parameters:
name - the option name.
hasArg - NO_ARG, REQ_ARG, or OPT_ARG.
val - the equivalent short (one-char) option name.
Method Detail

toString

public java.lang.String toString()
Convert this option into a printable string.

Overrides:
toString in class java.lang.Object
Returns:
the string.