edu.rice.cs.drjava.config
Class BooleanOption

java.lang.Object
  extended by edu.rice.cs.drjava.config.OptionParser<T>
      extended by edu.rice.cs.drjava.config.Option<Boolean>
          extended by edu.rice.cs.drjava.config.BooleanOption
All Implemented Interfaces:
FormatStrategy<Boolean>, ParseStrategy<Boolean>

public class BooleanOption
extends Option<Boolean>

Class defining all configuration options with values of type Boolean.

Version:
$Id: BooleanOption.java 4447 2008-04-18 16:06:34Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.config.OptionParser
defaultValue, name
 
Constructor Summary
BooleanOption(String key, Boolean def)
           
 
Method Summary
 Boolean parse(String s)
          The ability to parse a string to an object of type T.
 
Methods inherited from class edu.rice.cs.drjava.config.Option
format, getDefaultString
 
Methods inherited from class edu.rice.cs.drjava.config.OptionParser
getDefault, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanOption

public BooleanOption(String key,
                     Boolean def)
Parameters:
key - The name of this option.
Method Detail

parse

public Boolean parse(String s)
Description copied from class: OptionParser
The ability to parse a string to an object of type T. All concrete versions of this class must override this method to provide some sort of parser implementation.

Specified by:
parse in interface ParseStrategy<Boolean>
Specified by:
parse in class OptionParser<Boolean>
Parameters:
s - The String to be parsed.
Returns:
A Boolean instance represented by "s".
Throws:
IllegalArgumentException - if "s" is not one of the Strings "true" and "false".