nachos.machine
Class Config

java.lang.Object
  extended by nachos.machine.Config

public final class Config
extends Object

Provides routines to access the Nachos configuration.


Constructor Summary
Config()
           
 
Method Summary
static boolean getBoolean(String key)
          Get the value of a boolean key in nachos.conf.
static boolean getBoolean(String key, boolean defaultValue)
          Get the value of a boolean key in nachos.conf, returning the specified default if the key does not exist.
static double getDouble(String key)
          Get the value of a double key in nachos.conf.
static double getDouble(String key, double defaultValue)
          Get the value of a double key in nachos.conf, returning the specified default if the key does not exist.
static int getInteger(String key)
          Get the value of an integer key in nachos.conf.
static int getInteger(String key, int defaultValue)
          Get the value of an integer key in nachos.conf, returning the specified default if the key does not exist.
static String getString(String key)
          Get the value of a key in nachos.conf.
static String getString(String key, String defaultValue)
          Get the value of a key in nachos.conf, returning the specified default if the key does not exist.
static void load(String fileName)
          Load configuration information from the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Config

public Config()
Method Detail

load

public static void load(String fileName)
Load configuration information from the specified file. Must be called before the Nachos security manager is installed.

Parameters:
fileName - the name of the file containing the configuration to use.

getString

public static String getString(String key)
Get the value of a key in nachos.conf.

Parameters:
key - the key to look up.
Returns:
the value of the specified key, or null if it is not present.

getString

public static String getString(String key,
                               String defaultValue)
Get the value of a key in nachos.conf, returning the specified default if the key does not exist.

Parameters:
key - the key to look up.
defaultValue - the value to return if the key does not exist.
Returns:
the value of the specified key, or defaultValue if it is not present.

getInteger

public static int getInteger(String key)
Get the value of an integer key in nachos.conf.

Parameters:
key - the key to look up.
Returns:
the value of the specified key.

getInteger

public static int getInteger(String key,
                             int defaultValue)
Get the value of an integer key in nachos.conf, returning the specified default if the key does not exist.

Parameters:
key - the key to look up.
defaultValue - the value to return if the key does not exist.
Returns:
the value of the specified key, or defaultValue if the key does not exist.

getDouble

public static double getDouble(String key)
Get the value of a double key in nachos.conf.

Parameters:
key - the key to look up.
Returns:
the value of the specified key.

getDouble

public static double getDouble(String key,
                               double defaultValue)
Get the value of a double key in nachos.conf, returning the specified default if the key does not exist.

Parameters:
key - the key to look up.
defaultValue - the value to return if the key does not exist.
Returns:
the value of the specified key, or defaultValue if the key does not exist.

getBoolean

public static boolean getBoolean(String key)
Get the value of a boolean key in nachos.conf.

Parameters:
key - the key to look up.
Returns:
the value of the specified key.

getBoolean

public static boolean getBoolean(String key,
                                 boolean defaultValue)
Get the value of a boolean key in nachos.conf, returning the specified default if the key does not exist.

Parameters:
key - the key to look up.
defaultValue - the value to return if the key does not exist.
Returns:
the value of the specified key, or defaultValue if the key does not exist.