edu.rice.cs.drjava.config
Class IntegerOption

java.lang.Object
  extended by edu.rice.cs.drjava.config.OptionParser<T>
      extended by edu.rice.cs.drjava.config.Option<Integer>
          extended by edu.rice.cs.drjava.config.IntegerOption
All Implemented Interfaces:
FormatStrategy<Integer>, ParseStrategy<Integer>
Direct Known Subclasses:
NonNegativeIntegerOption

public class IntegerOption
extends Option<Integer>

Class defining all configuration options with values of type Integer.

Version:
$Id: IntegerOption.java 4544 2008-07-08 06:59:53Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.config.OptionParser
defaultValue, name
 
Constructor Summary
IntegerOption(String key, Integer def)
           
 
Method Summary
 Integer 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

IntegerOption

public IntegerOption(String key,
                     Integer def)
Parameters:
key - The name of this Option.
def - The default value for this option
Method Detail

parse

public Integer 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<Integer>
Specified by:
parse in class OptionParser<Integer>
Parameters:
s - The String to be parsed.
Returns:
The Integer object represented by "s".
Throws:
IllegalArgumentException - if "s" does not represent an integer value: only Strings that can be generated by the method Integer.toString() are supported.