ipipan.spejd.util
Class ConfigDict

java.lang.Object
  extended by ipipan.spejd.util.SimpleDict
      extended by ipipan.spejd.util.ConfigDict

public class ConfigDict
extends SimpleDict

Configuration class, containing a set of variables with values.


Field Summary
static java.lang.String configFilename
          The name of the default configuration file.
 
Fields inherited from class ipipan.spejd.util.SimpleDict
dict
 
Constructor Summary
ConfigDict(java.lang.String filename)
          Creates a new configuration with variables loaded from a given filename.
 
Method Summary
 java.lang.String get(java.lang.String var)
          Gets the value of a configuration String variable.
 boolean getBool(java.lang.String var)
          Gets the value of a configuration boolean variable.
 char getChar(java.lang.String var, java.lang.String allowed)
           
 java.lang.String getDir(java.lang.String var)
           
 int getHex(java.lang.String var)
          Gets the value of a configuration hexadecimal variable.
 int getInt(java.lang.String var)
          Gets the value of a configuration int variable.
static boolean isAssignment(java.lang.String assign)
           
 java.lang.String notFound(java.lang.String var)
          Method called when a requested variable can not be found.
 boolean putAssignment(java.lang.String assign)
          Sets value of a configuration variable.
 boolean putAssignments(java.lang.String[] args, int start, int end)
           
 
Methods inherited from class ipipan.spejd.util.SimpleDict
getDict, load, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configFilename

public static final java.lang.String configFilename
The name of the default configuration file.

See Also:
Constant Field Values
Constructor Detail

ConfigDict

public ConfigDict(java.lang.String filename)
Creates a new configuration with variables loaded from a given filename.

Method Detail

isAssignment

public static boolean isAssignment(java.lang.String assign)

putAssignment

public boolean putAssignment(java.lang.String assign)
Sets value of a configuration variable.

Parameters:
assign - assignment in a form of variable=value
Returns:
true, if assign is valid assignment, false otherwise

putAssignments

public boolean putAssignments(java.lang.String[] args,
                              int start,
                              int end)

get

public java.lang.String get(java.lang.String var)
Gets the value of a configuration String variable.

Parameters:
var - name of the variable to get
Returns:
value of the variable

getInt

public int getInt(java.lang.String var)
Gets the value of a configuration int variable.

Parameters:
var - name of the variable to get
Returns:
value of the variable

getHex

public int getHex(java.lang.String var)
Gets the value of a configuration hexadecimal variable.

Parameters:
var - name of the variable to get
Returns:
value of the variable

getBool

public boolean getBool(java.lang.String var)
Gets the value of a configuration boolean variable.

Parameters:
var - name of the variable to get
Returns:
value of the variable

getDir

public java.lang.String getDir(java.lang.String var)

getChar

public char getChar(java.lang.String var,
                    java.lang.String allowed)

notFound

public java.lang.String notFound(java.lang.String var)
Method called when a requested variable can not be found. Can be overriden by subclasses to allow a "plan B".

Parameters:
var - name of the variable requested
Returns:
null