lib
Class Configuration

java.lang.Object
  extended by lib.Configuration

public class Configuration
extends java.lang.Object

The configuration class encapsulates the abilities to modify program settings and attributes and store them to file.

Version:
1.0
Author:
CobaltSoftware (abode.devteam@cobaltsoftware.net)

Field Summary
private static java.util.ArrayList sections
           
 
Constructor Summary
private Configuration()
          Private constructor to prevent instanciation
 
Method Summary
static java.util.ArrayList getByKey(java.lang.String path)
          Look up a configuration file section by a slash delimited path
static java.awt.Color getRGB(java.lang.String key)
          Load a colour value from the configuration
private static java.util.ArrayList recurse(java.util.ArrayList input, int index)
          Recursively load elements
private static java.lang.String recurseList(boolean first, java.util.ArrayList list, int depth)
          Recurse the list and generate output
static void update()
          Update configuration file and save changes to disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sections

private static java.util.ArrayList sections
Constructor Detail

Configuration

private Configuration()
Private constructor to prevent instanciation

Method Detail

recurse

private static java.util.ArrayList recurse(java.util.ArrayList input,
                                           int index)
Recursively load elements

Parameters:
input - Array of LispBlob objects that must be traversed
index - Recusive depth inside lists

getByKey

public static java.util.ArrayList getByKey(java.lang.String path)
Look up a configuration file section by a slash delimited path

Parameters:
path - Path in configuration to load
Returns:
Arraylist of elements at this point

update

public static void update()
Update configuration file and save changes to disk


recurseList

private static java.lang.String recurseList(boolean first,
                                            java.util.ArrayList list,
                                            int depth)
Recurse the list and generate output

Parameters:
first - Is this the first level element?
list - List to recursively build from
depth - Recursive depth in lists
Returns:
Composited lisp syntax representing contents of arraylist

getRGB

public static java.awt.Color getRGB(java.lang.String key)
Load a colour value from the configuration

Parameters:
Path - to find the colour at
Returns:
Configuration setting in the form of a colour