Class GetOpt.LongOption

Object
  extended by GetOpt.LongOption
Enclosing class:
GetOpt

public static class GetOpt.LongOption
extends 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.
 String name
          The option name (for example, "color").
 char val
          The equivalent short (one-char) option name (for example 'c').
 
Constructor Summary
GetOpt.LongOption(String name, int hasArg, char val)
          Create a LongOption from its components.
 
Method Summary
 String toString()
          Convert this option into a printable string.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public 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(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 String toString()
Convert this option into a printable string.

Overrides:
toString in class Object
Returns:
the string.