info.rolandkrueger.roklib.cli
Enum CommandLineOptionType

java.lang.Object
  extended by java.lang.Enum<CommandLineOptionType>
      extended by info.rolandkrueger.roklib.cli.CommandLineOptionType
All Implemented Interfaces:
Serializable, Comparable<CommandLineOptionType>

public enum CommandLineOptionType
extends Enum<CommandLineOptionType>

Enum to specify the type of an option.

See Also:
CommandLineOption

Enum Constant Summary
FLAG
          A flag option cannot be given any value.
LIST
          A list option consists of the option name and a list of values.
SINGULAR
          A singular option can be used to provide exactly one value.
 
Method Summary
static CommandLineOptionType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CommandLineOptionType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FLAG

public static final CommandLineOptionType FLAG
A flag option cannot be given any value. It stands for itself.
Example: $ programname --output_off


LIST

public static final CommandLineOptionType LIST
A list option consists of the option name and a list of values.
In the following example, --files is a list option:
$ programname --files file1 file2 file2


SINGULAR

public static final CommandLineOptionType SINGULAR
A singular option can be used to provide exactly one value.
Example: $ programname --count 42

Method Detail

values

public static CommandLineOptionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CommandLineOptionType c : CommandLineOptionType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CommandLineOptionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2007-2011. All Rights Reserved.