[]
This class holds modules options and parameters as they are provided to the encoder or the decoder. Each option and its associated parameters are stored as strings.
<p>This class is built on the standard Java Properties class. Consequently,
it offers facilities to load and write parameters from/to a file. In the
meantime, a ParameterList object can also handle default parameters for
each option.</p><p>Each parameter can be retrieved as a string or as an specific primitive
type (int, float, etc).</p><p>For more details see the Properties class.</p><p>Note that this class does not support multiple occurrences of parameters
(for a parameter name, only one value is possible). Also there is no
particular order of the parameters.</p>
public class ParameterList : Dictionary<string, string>, IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IDictionary, ICollection, IReadOnlyDictionary<string, string>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, ISerializable, IDeserializationCallback
Name | Description |
---|---|
ParameterList() | Constructs an empty ParameterList object. It can be later completed by adding elements one by one, by loading them from a file, or by initializing them from an argument string. |
ParameterList(ParameterList) | Constructs an empty ParameterList object with the provided default parameters. The list can be later updated by adding elements one by one, by loading them from a file, or by initializing them from an argument string. |
Name | Description |
---|---|
DefaultParameterList | Returns the default ParameterList. |
Name | Description |
---|---|
checkList(char, string[]) | Checks if the parameters which name starts with the prefix 'prfx' in the parameter list are all in the list of valid parameter names 'plist'. If there is a parameter that is not in 'plist' an IllegalArgumentException is thrown with an explanation message. The default parameters are also included in the check. |
checkList(char[], string[]) | Checks if the parameters which names do not start with any of the prefixes in 'prfxs' in this ParameterList are all in the list of valid parameter names 'plist'. If there is a parameter that is not in 'plist' an IllegalArgumentException is thrown with an explanation message. The default parameters are also included in the check. |
getBooleanParameter(string) | Returns the value of the named parameter as a boolean. The value "on" is interpreted as 'true', while the value "off" is interpreted as 'false'. If the parameter has another value then an StringFormatException is thrown. If the parameter 'pname' is not in the parameter list, an IllegalArgumentException is thrown. |
getFloatParameter(string) | Returns the value of the named parameter as a float. If the parameter has a non-numeric value a NumberFormatException is thrown. If the parameter has a multiple word value than the first word is returned as an int, others are ignored. If the parameter 'pname' is not in the parameter list, an IllegalArgumentException is thrown. |
getIntParameter(string) | Returns the value of the named parameter as an int. If the parameter has a non-numeric value a NumberFormatException is thrown. If the parameter has a multiple word value than the first word is returned as an int, others are ignored. If the parameter 'pname' is not in the parameter list, an IllegalArgumentException is thrown. |
getParameter(string) | Returns the value of the named parameter, as a string. The value can come from teh defaults, if there are. |
parseArgs(string[]) | |
toNameArray(string[][]) | Converts the usage information to a list of parameter names in a single array. The usage information appears in a 2D array of String. The first dimensions contains the different options, the second dimension contains the name of the option (first element), the synopsis and the explanation. This method takes the names of the different options in 'pinfo' and returns them in a single array of String. |