| edu.rice.cs.drjava.config.ForcedChoiceOption
ForcedChoiceOption | public class ForcedChoiceOption extends Option (Code) | | Class defining a configuration option that requires a choice between
mutually-exclusive possible values. Values are stored as Strings, though
this could be extended to any type with a fairly simple refactoring.
version: $Id: ForcedChoiceOption.java 4255 2007-08-28 19:17:37Z mgricken $ |
Method Summary | |
public String | format(String s) Parameters: s - The String to be formatted. | public Iterator<String> | getLegalValues() Gets all legal values of this option. | public int | getNumValues() Gets the number of legal values for this option. | public boolean | isLegal(String s) Checks whether the parameter String is a legal value for this option. | public String | parse(String s) Parses an arbitrary String into an acceptable value for this option.
Parameters: s - The String to be parsed. |
ForcedChoiceOption | public ForcedChoiceOption(String key, String def, Collection<String> choices)(Code) | | Parameters: key - The name of this option. Parameters: def - The default value of the option. Parameters: choices - A collection of all possible values of this Option, as Strings. |
format | public String format(String s)(Code) | | Parameters: s - The String to be formatted. "s", no actual formatting is performed. |
getLegalValues | public Iterator<String> getLegalValues()(Code) | | Gets all legal values of this option.
an Iterator containing the set of all Strings for which isLegal returns true. |
getNumValues | public int getNumValues()(Code) | | Gets the number of legal values for this option.
an int indicating the number of legal values. |
isLegal | public boolean isLegal(String s)(Code) | | Checks whether the parameter String is a legal value for this option.
The input String must be formatted exactly like the original, as defined
by String.equals(String).
Parameters: s - the value to check true if s is legal, false otherwise |
parse | public String parse(String s)(Code) | | Parses an arbitrary String into an acceptable value for this option.
Parameters: s - The String to be parsed. s, if s is a legal value of this option. exception: IllegalArgumentException - if "s" is not one of the allowed values. |
|
|