org.jikesrvm.options
Class OptionSet

java.lang.Object
  extended by org.vmutil.options.OptionSet
      extended by org.jikesrvm.options.OptionSet

public final class OptionSet
extends OptionSet

Class to handle command-line arguments and options for GC.


Field Summary
static OptionSet gc
           
private  String prefix
           
 
Constructor Summary
private OptionSet(String prefix)
           
 
Method Summary
protected  int bytesToPages(Extent bytes)
          Convert bytes into pages, rounding up if necessary.
protected  String computeKey(String name)
          Determine the VM specific key for a given option name.
protected  void fail(Option o, String message)
          A fatal error occurred during the setting of an option.
protected  void logNewLine()
          Print a new line.
protected  void logString(String s)
          Log a string.
protected  void logValue(Option o, boolean forXml)
          Format and log an option value.
protected  Extent pagesToBytes(int pages)
          Convert from pages into bytes.
 void printHelp()
          Print a short description of every option
 void printOptions()
          Print out the option values
 boolean process(String arg)
          Take a string (most likely a command-line argument) and try to proccess it as an option command.
protected  void warn(Option o, String message)
          A non-fatal error occurred during the setting of an option.
 
Methods inherited from class org.vmutil.options.OptionSet
getFirst, getOption, log, logChange, logXml, logXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefix

private String prefix

gc

public static final OptionSet gc
Constructor Detail

OptionSet

private OptionSet(String prefix)
Method Detail

process

public boolean process(String arg)
Take a string (most likely a command-line argument) and try to proccess it as an option command. Return true if the string was understood, false otherwise.

Parameters:
arg - a String to try to process as an option command
Returns:
true if successful, false otherwise

printHelp

public void printHelp()
Print a short description of every option


printOptions

public void printOptions()
Print out the option values


logValue

protected void logValue(Option o,
                        boolean forXml)
Description copied from class: OptionSet
Format and log an option value.

Specified by:
logValue in class OptionSet
Parameters:
o - The option.
forXml - Is this part of XML output?

logString

protected void logString(String s)
Description copied from class: OptionSet
Log a string.

Specified by:
logString in class OptionSet

logNewLine

protected void logNewLine()
Description copied from class: OptionSet
Print a new line.

Specified by:
logNewLine in class OptionSet

computeKey

protected String computeKey(String name)
Description copied from class: OptionSet
Determine the VM specific key for a given option name. Option names are space delimited with capitalised words (e.g. "GC Verbosity Level").

Specified by:
computeKey in class OptionSet
Parameters:
name - The option name.
Returns:
The VM specific key.

warn

protected void warn(Option o,
                    String message)
Description copied from class: OptionSet
A non-fatal error occurred during the setting of an option. This method calls into the VM and shall not cause the system to stop.

Specified by:
warn in class OptionSet
Parameters:
o - The responsible option.
message - The message associated with the warning.

fail

protected void fail(Option o,
                    String message)
Description copied from class: OptionSet
A fatal error occurred during the setting of an option. This method calls into the VM and is required to cause the system to stop.

Specified by:
fail in class OptionSet
Parameters:
o - The responsible option.
message - The error message associated with the failure.

bytesToPages

protected int bytesToPages(Extent bytes)
Description copied from class: OptionSet
Convert bytes into pages, rounding up if necessary.

Specified by:
bytesToPages in class OptionSet
Parameters:
bytes - The number of bytes.
Returns:
The corresponding number of pages.

pagesToBytes

protected Extent pagesToBytes(int pages)
Description copied from class: OptionSet
Convert from pages into bytes.

Specified by:
pagesToBytes in class OptionSet
Parameters:
pages - the number of pages.
Returns:
The corresponding number of bytes.