org.vmutil.options
Class PagesOption

java.lang.Object
  extended by org.vmutil.options.Option
      extended by org.vmutil.options.PagesOption
Direct Known Subclasses:
BoundedNursery, CycleFilterThreshold, CycleMetaDataLimit, CycleTriggerThreshold, DefragFreeHeadroom, DefragHeadroom, FixedNursery, MetaDataLimit, StressFactor

public class PagesOption
extends Option

A memory option that stores values as a whole number of pages.


Field Summary
protected  int defaultValue
           
protected  int 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 PagesOption(OptionSet set, String name, String desc, int defaultPages)
          Create a new pages option.
 
Method Summary
 Extent getBytes()
          Read the current value of the option in bytes.
 Extent getDefaultBytes()
          Read the default value of the option in bytes.
 int getDefaultPages()
          Read the default value of the option in pages.
 int getPages()
          Read the current value of the option in pages.
 void setBytes(Extent value)
          Update the value of the option, echoing the change if logChanges is set.
 void setDefaultPages(int value)
          Modify the default value of the option.
 void setPages(int pages)
          Update the value of the option, echoing the change if logChanges 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 int defaultValue

value

protected int value
Constructor Detail

PagesOption

protected PagesOption(OptionSet set,
                      String name,
                      String desc,
                      int defaultPages)
Create a new pages option.

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

getPages

public int getPages()
Read the current value of the option in pages.

Returns:
The option value.

getBytes

public Extent getBytes()
Read the current value of the option in bytes.

Returns:
The option value.

getDefaultBytes

public Extent getDefaultBytes()
Read the default value of the option in bytes.

Returns:
The default value.

getDefaultPages

public int getDefaultPages()
Read the default value of the option in pages.

Returns:
The default value.

setBytes

public void setBytes(Extent value)
Update the value of the option, echoing the change if logChanges is set. A warning is raised if the value is not a whole multiple of pages, and then the validate method is called to allow subclasses to perform any additional validation.

Parameters:
value - The new value for the option.

setPages

public void setPages(int pages)
Update the value of the option, echoing the change if logChanges is set. The validate method is called to allow subclasses to perform any additional validation.

Parameters:
pages - The new value for the option.

setDefaultPages

public void setDefaultPages(int value)
Modify the default value of the option.

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