org.vmutil.options
Class BooleanOption

java.lang.Object
  extended by org.vmutil.options.Option
      extended by org.vmutil.options.BooleanOption
Direct Known Subclasses:
DefragStress, EagerCompleteSweep, EagerMmapSpaces, EchoOptions, FragmentationStats, FullHeapSystemGC, GCspyWait, GenCycleDetection, HarnessAll, IgnoreSystemGC, NoFinalizer, NoReferenceTypes, PrintPhaseStats, ProtectOnRelease, SanityCheck, UseReturnBarrier, VariableSizeHeap, VerboseFragmentationStats, VerboseTiming, XmlStats

public class BooleanOption
extends Option

Base class for boolean options.


Field Summary
protected  boolean defaultValue
           
protected  boolean 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 BooleanOption(OptionSet set, String name, String desc, boolean defaultValue)
          Create a new boolean option.
 
Method Summary
 boolean getDefaultValue()
          Read the default value of the option.
 boolean getValue()
          Read the current value of the option.
 void setDefaultValue(boolean value)
          Modify the default value of the option.
 void setValue(boolean 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 boolean defaultValue

value

protected boolean value
Constructor Detail

BooleanOption

protected BooleanOption(OptionSet set,
                        String name,
                        String desc,
                        boolean defaultValue)
Create a new boolean 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 boolean getValue()
Read the current value of the option.

Returns:
The option value.

getDefaultValue

public boolean getDefaultValue()
Read the default value of the option.

Returns:
The default value.

setValue

public void setValue(boolean 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(boolean value)
Modify the default value of the option.

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