Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ipipan.spejd.util
Class ConfigDict

    java.lang.Object
      ipipan.spejd.util.SimpleDict
          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.
`protected java.util.TreeMap<java.lang.String,T>` | `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.
`java.lang.String[]` | `getArray(java.lang.String var, java.lang.String separator)`
`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.util.TreeMap<java.lang.String,T>` | `getDict()`
`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.
`boolean` | `isAssignment(java.lang.String assign)`
`void` | `load(java.lang.String filename)` Loads configuration from a specified file.
`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
`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

### dict

    protected java.util.TreeMap<java.lang.String,T> dict

Constructor Detail

### ConfigDict

    public ConfigDict(java.lang.String filename)

  Creates a new configuration with variables loaded from a given filename.

Method Detail

### isAssignment

    public 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)

### getArray

    public java.lang.String[] getArray(java.lang.String var,
                                       java.lang.String separator)

### 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

### load

    public void load(java.lang.String filename)

  Loads configuration from a specified file.

  Parameters:
    `filename` - name of the configuration file

### getDict

    public java.util.TreeMap<java.lang.String,T> getDict()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD