edu.rice.cs.drjava.config
Class NonNegativeIntegerOption

java.lang.Object
  |
  +--edu.rice.cs.drjava.config.OptionParser
        |
        +--edu.rice.cs.drjava.config.Option
              |
              +--edu.rice.cs.drjava.config.IntegerOption
                    |
                    +--edu.rice.cs.drjava.config.NonNegativeIntegerOption
All Implemented Interfaces:
FormatStrategy, ParseStrategy

public class NonNegativeIntegerOption
extends IntegerOption

Class defining all configuration options with values of type NonNegativeInteger.

Version:
$Id: NonNegativeIntegerOption.java,v 1.1 2002/07/09 19:58:06 jhsia Exp $

Fields inherited from class edu.rice.cs.drjava.config.Option
listeners
 
Fields inherited from class edu.rice.cs.drjava.config.OptionParser
defaultValue, map, name
 
Constructor Summary
NonNegativeIntegerOption(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.IntegerOption
format, getDefault, getOption, notifyListeners, remove, setOption, setString
 
Methods inherited from class edu.rice.cs.drjava.config.Option
addListener, getDefaultString, getString, removeListener
 
Methods inherited from class edu.rice.cs.drjava.config.OptionParser
getName
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

NonNegativeIntegerOption

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