ml.options
Class OptionData

java.lang.Object
  extended by ml.options.OptionData

public class OptionData
extends Object

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.


Method Summary
 int getResultCount()
          Get the number of results found for this option, which is number of times the key matched
 String getResultDetail(int index)
          Get the detail with the given index.
 String getResultValue(int index)
          Get the value with the given index.
 String toString()
          This is the overloaded Object.toString() method, and it is provided mainly for debugging purposes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getResultCount

public int getResultCount()
Get the number of results found for this option, which is number of times the key matched

Returns:
The number of results

getResultValue

public String 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

Throws:
IllegalArgumentException - If the value for index is out of bounds

getResultDetail

public String 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

Throws:
IllegalArgumentException - If the value for index is out of bounds

toString

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

Overrides:
toString in class Object
Returns:
A string representing the instance