org.vmutil.options
Class MicrosecondsOption

java.lang.Object
  extended by org.vmutil.options.Option
      extended by org.vmutil.options.MicrosecondsOption
Direct Known Subclasses:
GCTimeCap

public class MicrosecondsOption
extends Option

A time option that stores values at a microsecond granularity.


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 MicrosecondsOption(OptionSet set, String name, String desc, int defaultUs)
          Create a new microsecond option.
 
Method Summary
 int getDefaultMicroseconds()
          Read the default value of the option in microseconds.
 int getDefaultMilliseconds()
          Read the default value of the option in milliseconds.
 int getMicroseconds()
          Read the current value of the option in microseconds.
 int getMilliseconds()
          Read the current value of the option in milliseconds.
 void setDefaultMicrosends(int value)
          Modify the default value of the option.
 void setMicroseconds(int 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 int defaultValue

value

protected int value
Constructor Detail

MicrosecondsOption

protected MicrosecondsOption(OptionSet set,
                             String name,
                             String desc,
                             int defaultUs)
Create a new microsecond option.

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

getMicroseconds

public int getMicroseconds()
Read the current value of the option in microseconds.

Returns:
The option value.

getMilliseconds

public int getMilliseconds()
Read the current value of the option in milliseconds.

Returns:
The option value.

getDefaultMicroseconds

public int getDefaultMicroseconds()
Read the default value of the option in microseconds.

Returns:
The default value.

getDefaultMilliseconds

public int getDefaultMilliseconds()
Read the default value of the option in milliseconds.

Returns:
The default value.

setMicroseconds

public void setMicroseconds(int value)
Update the value of the option, echoing the change if the echoOptions option is set. An error occurs if the value is negative, and then the validate method is called to allow subclasses to perform any additional validation.

Parameters:
value - The new value for the option.

setDefaultMicrosends

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

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