commandlineprocessing.OptionData Class Reference

Collaboration diagram for commandlineprocessing.OptionData:

Collaboration graph
[legend]

List of all members.

Public Member Functions

int getResultCount ()
String getResultValue (int index)
String getResultDetail (int index)
String toString ()

Package Functions

 OptionData (Options.Prefix prefix, String key, boolean detail, Options.Separator separator, boolean value, Options.Multiplicity multiplicity)
Options.Prefix getPrefix ()
String getKey ()
boolean useDetail ()
Options.Separator getSeparator ()
boolean useValue ()
Options.Multiplicity getMultiplicity ()
java.util.regex.Pattern getPattern ()
void addResult (String valueData, String detailData)

Private Attributes

Options.Prefix prefix = null
String key = null
boolean detail = false
Options.Separator separator = null
boolean value = false
Options.Multiplicity multiplicity = null
java.util.regex.Pattern pattern = null
int counter = 0
java.util.ArrayList< String > values = null
java.util.ArrayList< String > details = null

Static Private Attributes

static final String CLASS = "OptionData"


Detailed Description

This class holds all the data for an option. This includes the prefix, the key, the separator (for value options), the multiplicity, and all the other settings describing the option. The class is designed to be only a data container from a user perspective, i. e. the user has read-access to any data determined by the Options#check(), but not access to any of the other methods which are used internally for the operation of the actual check.

Definition at line 11 of file OptionData.java.


Constructor & Destructor Documentation

commandlineprocessing.OptionData.OptionData ( Options.Prefix  prefix,
String  key,
boolean  detail,
Options.Separator  separator,
boolean  value,
Options.Multiplicity  multiplicity 
) [package]

The constructor

Definition at line 30 of file OptionData.java.


Member Function Documentation

Options.Prefix commandlineprocessing.OptionData.getPrefix (  )  [package]

Getter method for prefix property

Returns:
The value for the prefix property

Definition at line 87 of file OptionData.java.

String commandlineprocessing.OptionData.getKey (  )  [package]

Getter method for key property

Returns:
The value for the key property

Definition at line 97 of file OptionData.java.

boolean commandlineprocessing.OptionData.useDetail (  )  [package]

Getter method for detail property

Returns:
The value for the detail property

Definition at line 107 of file OptionData.java.

Options.Separator commandlineprocessing.OptionData.getSeparator (  )  [package]

Getter method for separator property

Returns:
The value for the separator property

Definition at line 117 of file OptionData.java.

boolean commandlineprocessing.OptionData.useValue (  )  [package]

Getter method for value property

Returns:
The value for the value property

Definition at line 127 of file OptionData.java.

Options.Multiplicity commandlineprocessing.OptionData.getMultiplicity (  )  [package]

Getter method for multiplicity property

Returns:
The value for the multiplicity property

Definition at line 137 of file OptionData.java.

java.util.regex.Pattern commandlineprocessing.OptionData.getPattern (  )  [package]

Getter method for pattern property

Returns:
The value for the pattern property

Definition at line 147 of file OptionData.java.

int commandlineprocessing.OptionData.getResultCount (  ) 

Get the number of results found for this option, which is number of times the key matched

Returns:
The number of results

Definition at line 157 of file OptionData.java.

Referenced by commandlineprocessing.OptionData.getResultDetail(), and commandlineprocessing.OptionData.getResultValue().

String commandlineprocessing.OptionData.getResultValue ( int  index  ) 

Get the value with the given index. The index can range between 0 and getResultCount() - 1. However, only for value options, a non-null value will be returned. Non-value options always return null.

Parameters:
index The index for the desired value
Returns:
The option value with the given index
Exceptions:
IllegalArgumentException If the value for index is out of bounds

Definition at line 177 of file OptionData.java.

String commandlineprocessing.OptionData.getResultDetail ( int  index  ) 

Get the detail with the given index. The index can range between 0 and getResultCount() - 1. However, only for value options which take details, a non-null detail will be returned. Non-value options and value options which do not take details always return null.

Parameters:
index The index for the desired value
Returns:
The option detail with the given index
Exceptions:
IllegalArgumentException If the value for index is out of bounds

Definition at line 195 of file OptionData.java.

void commandlineprocessing.OptionData.addResult ( String  valueData,
String  detailData 
) [package]

Store the data for a match found

Definition at line 205 of file OptionData.java.

String commandlineprocessing.OptionData.toString (  ) 

This is the overloaded Object#toString() method, and it is provided mainly for debugging purposes.

Returns:
A string representing the instance

Definition at line 224 of file OptionData.java.


Member Data Documentation

final String commandlineprocessing.OptionData.CLASS = "OptionData" [static, private]

String commandlineprocessing.OptionData.key = null [private]

boolean commandlineprocessing.OptionData.detail = false [private]

boolean commandlineprocessing.OptionData.value = false [private]

java.util.regex.Pattern commandlineprocessing.OptionData.pattern = null [private]

java.util.ArrayList<String> commandlineprocessing.OptionData.values = null [private]

java.util.ArrayList<String> commandlineprocessing.OptionData.details = null [private]


The documentation for this class was generated from the following file:

Generated on Tue Jul 8 15:04:07 2008 for NODIC by  doxygen 1.5.5