org.crosswire.common.options
Enum ArgumentType

java.lang.Object
  extended by java.lang.Enum<ArgumentType>
      extended by org.crosswire.common.options.ArgumentType
All Implemented Interfaces:
Serializable, Comparable<ArgumentType>

public enum ArgumentType
extends Enum<ArgumentType>

An ArgumentType indicates whether and/or how an Option is followed by an argument.

Author:
DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Enum Constant Summary
NO_ARGUMENT
          The option is not followed by an argument.
OPTIONAL_ARGUMENT
          The option may be followed by an argument.
REQUIRED_ARGUMENT
          The option is followed by an argument.
 
Field Summary
private  String name
          The name of the DataType
 
Method Summary
static ArgumentType fromString(String name)
          Lookup method to convert from a String
 String toString()
           
static ArgumentType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ArgumentType[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NO_ARGUMENT

public static final ArgumentType NO_ARGUMENT
The option is not followed by an argument.


REQUIRED_ARGUMENT

public static final ArgumentType REQUIRED_ARGUMENT
The option is followed by an argument.


OPTIONAL_ARGUMENT

public static final ArgumentType OPTIONAL_ARGUMENT
The option may be followed by an argument.

Field Detail

name

private String name
The name of the DataType

Method Detail

values

public static ArgumentType[] 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 (ArgumentType c : ArgumentType.values())
    System.out.println(c);

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

valueOf

public static ArgumentType 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

fromString

public static ArgumentType fromString(String name)
Lookup method to convert from a String


toString

public String toString()
Overrides:
toString in class Enum<ArgumentType>

Copyright ? 2003-2011