talx x1.0.5

util
Class Settings

java.lang.Object
  extended byutil.Settings
Direct Known Subclasses:
Settings.MutableSettings

public class Settings
extends java.lang.Object

This class is a tool for reading in some training program settings from a plain text file. The name of the file or the inputstream must be passed into this class as an argument. Each line in the settings file much obey the format of SettingsConstants.java e.g. "settings.font=16"


Nested Class Summary
static class Settings.MutableSettings
          This inner class is of type Settings, but unlike Settings, it allows the settings to be written to a file.
 
Constructor Summary
Settings(java.io.InputStream in)
          This constructor loads the settings from an inputstream.
Settings(java.lang.String filename)
          This constructor loads the settings from a String filename.
 
Method Summary
 java.lang.String get(java.lang.String name)
          This method returns the value associated with some settings key.
 int getInt(java.lang.String name)
          This method returns the int value associated with some settings key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings(java.lang.String filename)
This constructor loads the settings from a String filename.

Parameters:
filename - Filename of the settings file.

Settings

public Settings(java.io.InputStream in)
This constructor loads the settings from an inputstream.

Parameters:
in - InputStream to the settings.
Method Detail

get

public java.lang.String get(java.lang.String name)
This method returns the value associated with some settings key.

Parameters:
name - Name of constant key.
Returns:
String The value of associated with argument.

getInt

public int getInt(java.lang.String name)
This method returns the int value associated with some settings key.

Parameters:
name - Name of constant key.
Returns:
the value of name as an int or zero if the value doesn't exist, or cannot be parsed as an int.

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.