org.vmutil.options
Class FloatOption

java.lang.Object
  extended by org.vmutil.options.Option
      extended by org.vmutil.options.FloatOption
Direct Known Subclasses:
DefragFreeHeadroomFraction, DefragHeadroomFraction, DefragLineReuseRatio, DefragSimpleSpillThreshold, LineReuseRatio, PretenureThresholdFraction

public class FloatOption
extends Option

An option that has a simple single precision floating point value.


Field Summary
protected  float defaultValue
           
protected  float value
           
 
Fields inherited from class org.vmutil.options.Option
ADDRESS_OPTION, BOOLEAN_OPTION, ENUM_OPTION, FLOAT_OPTION, INT_OPTION, MICROSECONDS_OPTION, PAGES_OPTION, RAW, READABLE, set, STRING_OPTION, XML
 
Constructor Summary
protected FloatOption(OptionSet set, String name, String desc, float defaultValue)
          Create a new float option.
 
Method Summary
 float getDefaultValue()
          Read the default value of the option
 float getValue()
          Read the current value of the option.
 void setDefaultValue(float value)
          Modify the default value of the option.
 void setValue(float value)
          Update the value of the option, echoing the change if the echoOptions option is set.
 
Methods inherited from class org.vmutil.options.Option
fail, failIf, getDescription, getKey, getName, getNext, getType, setNext, validate, warn, warnIf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultValue

protected float defaultValue

value

protected float value
Constructor Detail

FloatOption

protected FloatOption(OptionSet set,
                      String name,
                      String desc,
                      float defaultValue)
Create a new float option.

Parameters:
set - The option set this option belongs to.
name - The space separated name for the option.
desc - The purpose of the option
defaultValue - The default value of the option.
Method Detail

getValue

public float getValue()
Read the current value of the option.

Returns:
The option value.

getDefaultValue

public float getDefaultValue()
Read the default value of the option

Returns:
The default value.

setValue

public void setValue(float value)
Update the value of the option, echoing the change if the echoOptions option is set. This method also calls the validate method to allow subclasses to perform any required validation.

Parameters:
value - The new value for the option.

setDefaultValue

public void setDefaultValue(float value)
Modify the default value of the option.

Parameters:
value - The new default value for the option.