edu.rice.cs.drjava.config
Class ColorOption

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

public class ColorOption
extends Option<Color>

Class defining all configuration options with values of type Color.

Version:
$Id: ColorOption.java 4674 2008-11-05 18:37:06Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.config.OptionParser
defaultValue, name
 
Constructor Summary
ColorOption(String key, Color def)
           
 
Method Summary
 String format(Color c)
          Formats a statically typed T value as a String.
 Color 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
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

ColorOption

public ColorOption(String key,
                   Color def)
Method Detail

parse

public Color 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<Color>
Specified by:
parse in class OptionParser<Color>
Parameters:
s - a String to parse
Returns:
the statically-typed representation of the string value.

format

public String format(Color c)
Description copied from class: Option
Formats a statically typed T value as a String. The default implementation uses the toString() method.

Specified by:
format in interface FormatStrategy<Color>
Overrides:
format in class Option<Color>
Parameters:
c - the statically-typed value to format into a String