tribble.util
Class CmdOptDef

java.lang.Object
  extended bytribble.util.CmdOptDef

public class CmdOptDef
extends java.lang.Object

Command line option argument descriptor. This is used by the CmdOptIter class to describe one or more command line options and their associated parameter types.

Since:
2000-02-11
Version:
$Revision: 1.00 $ $Date: 2000-02-11 $
Author:
David R. Tribble ( david@tribble.com ).
Copyright ©2000 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.
See Also:
CmdOptIter

Field Summary
static int BOOL
          Boolean (enable/disable) parameter
static int LIST
          Parameter is a list
static int NONE
          No parameter
static int NUM
          Numeric integer parameter
static int OPT
          Optional parameter
static int STRING
          String parameter
static int VERS
          Class version number
 
Constructor Summary
CmdOptDef(char name)
          Constructor.
CmdOptDef(char name, int flags)
          Constructor.
CmdOptDef(char name, int flags, char sep)
          Constructor.
CmdOptDef(java.lang.String name)
          Constructor.
CmdOptDef(java.lang.String name, int flags)
          Constructor.
CmdOptDef(java.lang.String name, int flags, char sep)
          Constructor.
 
Method Summary
 char firstChar()
          Retrieves the first character of this command option's name (following the '-' or '+' character).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERS

public static final int VERS
Class version number

See Also:
Constant Field Values

NONE

public static final int NONE
No parameter

See Also:
Constant Field Values

STRING

public static final int STRING
String parameter

See Also:
Constant Field Values

NUM

public static final int NUM
Numeric integer parameter

See Also:
Constant Field Values

OPT

public static final int OPT
Optional parameter

See Also:
Constant Field Values

BOOL

public static final int BOOL
Boolean (enable/disable) parameter

See Also:
Constant Field Values

LIST

public static final int LIST
Parameter is a list

See Also:
Constant Field Values
Constructor Detail

CmdOptDef

public CmdOptDef(char name)
Constructor.

Parameters:
name - The character naming this option.

CmdOptDef

public CmdOptDef(java.lang.String name)
Constructor.

Parameters:
name - The character(s) naming this option.

CmdOptDef

public CmdOptDef(char name,
                 int flags)
Constructor.

Parameters:
name - The character naming this option.
flags - The type and modifiers of this option.

CmdOptDef

public CmdOptDef(java.lang.String name,
                 int flags)
Constructor.

Parameters:
name - The character(s) naming this option.
flags - The type and modifiers of this option.

CmdOptDef

public CmdOptDef(char name,
                 int flags,
                 char sep)
Constructor.

Parameters:
name - The character naming this option.
flags - The type and modifiers of this option.
sep - The character that is used to separate items in this option's parameter list.

CmdOptDef

public CmdOptDef(java.lang.String name,
                 int flags,
                 char sep)
Constructor.

Parameters:
name - The character(s) naming this option.
flags - The type and modifiers of this option.
sep - The character that is used to separate items in this option's parameter list.
Method Detail

firstChar

public char firstChar()
Retrieves the first character of this command option's name (following the '-' or '+' character).

Returns:
The initial character of this option's name.