net.kbox.common
Class KConfiguration

java.lang.Object
  extended by net.kbox.common.KConfiguration

public class KConfiguration
extends java.lang.Object

KConfiguration representing the configuration file "kbox.cfg.property".

Author:
blackBox

Method Summary
 void clear()
          Clear all cached data.
 KConfiguration config()
          Load the Configuration with default path "/kbox.cfg.property".
 KConfiguration config(java.lang.String path)
          Load the configuration with the specified path.
 java.util.Hashtable getAll()
           
 boolean getBoolean(java.lang.String name)
          Get a Boolean object with the name;.
 double getDouble(java.lang.String name)
          Get a double value with the name.
 float getFloat(java.lang.String name)
           
static KConfiguration getInstance()
          Create a KConfiguration.
 int getInt(java.lang.String name)
          Get a int value with the name.
 long getLong(java.lang.String name)
           
 short getShort(java.lang.String name)
           
 java.lang.String getString(java.lang.String name)
          Get a String value with the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static KConfiguration getInstance()
Create a KConfiguration. Thread safe.


config

public KConfiguration config()
Load the Configuration with default path "/kbox.cfg.property".


config

public KConfiguration config(java.lang.String path)
Load the configuration with the specified path.

Parameters:
path -

clear

public void clear()
Clear all cached data.


getDouble

public double getDouble(java.lang.String name)
Get a double value with the name.

Parameters:
name -
Returns:
if the property dose not exit, -1 will be returned.

getInt

public int getInt(java.lang.String name)
Get a int value with the name.

Parameters:
name -
Returns:
if the property dose not exit, -1 will be returned.

getString

public java.lang.String getString(java.lang.String name)
Get a String value with the name.

Parameters:
name -
Returns:
if the property dose not exit, null will be returned.

getShort

public short getShort(java.lang.String name)

getLong

public long getLong(java.lang.String name)

getFloat

public float getFloat(java.lang.String name)

getBoolean

public boolean getBoolean(java.lang.String name)
Get a Boolean object with the name;.

Parameters:
name -
Returns:
if the property dose not exit, null will be returned.

getAll

public java.util.Hashtable getAll()