More information


de.spieleck.config
Class EmptyConfigNode

java.lang.Object
  |
  +--de.spieleck.config.EmptyConfigNode
All Implemented Interfaces:
ConfigNode

public class EmptyConfigNode
extends java.lang.Object
implements ConfigNode

An ConfigNode, that contains nothing. Might sometimes be a better return than a null for a ConfigNode returning device.


Method Summary
 java.util.Iterator children()
          Enumerate my children.
 java.util.Iterator childrenNamed(java.lang.String key)
          Enumerate children of me, having a certain name.
 int countChildren()
          Count the number of children we have.
 int countChildrenNamed(java.lang.String key)
          Count the number of children we have.
 boolean getBoolean()
          Get value as a boolean.
 boolean getBoolean(java.lang.String path, boolean deflt)
          Get value of subnode as boolean, using default if necessary.
 ConfigFileNode getBranchNode()
          Find the node responsible for reading this node from file.
 double getDouble()
          Get value as a double.
 double getDouble(java.lang.String path, double deflt)
          Get value of subnode as double, using default when necessary.
 boolean getInhBoolean(java.lang.String path, boolean deflt)
          Get value of subnode as boolean searching parent nodes before using default.
 double getInhDouble(java.lang.String path, double deflt)
          Get value of subnode as double searching parent nodes before using default.
 int getInhInt(java.lang.String path, int deflt)
          Get value of subnode as int searching parent nodes before using default.
 java.lang.String getInhString(java.lang.String path, java.lang.String deflt)
          Get value of subnode as String searching parent nodes before using default.
static ConfigNode getInstance()
           
 int getInt()
          Get value as an integer.
 int getInt(java.lang.String path, int deflt)
          Get value of subnode as integer, using default when necessary.
 java.lang.String getName()
          Get the name of the node.
 ConfigNode getParent()
          Get the node above.
 java.lang.String getPath()
          Get the complete path of the node.
 java.lang.String getString()
          Get value as String.
 java.lang.String getString(java.lang.String path, java.lang.String deflt)
          Get value of subnode as String, using default when necessary.
 ConfigNode node(java.lang.String path)
          Find sub node matching name.
 ConfigNode nodeInh(java.lang.String path)
          Find node or parent sub node matching name.
 void print(java.io.PrintWriter os)
          Pretty print this node with its whole subtree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConfigNode getInstance()

node

public ConfigNode node(java.lang.String path)
Description copied from interface: ConfigNode
Find sub node matching name.
Specified by:
node in interface ConfigNode

nodeInh

public ConfigNode nodeInh(java.lang.String path)
Description copied from interface: ConfigNode
Find node or parent sub node matching name.
Specified by:
nodeInh in interface ConfigNode

getBranchNode

public ConfigFileNode getBranchNode()
Description copied from interface: ConfigNode
Find the node responsible for reading this node from file.
Specified by:
getBranchNode in interface ConfigNode

getName

public java.lang.String getName()
Description copied from interface: ConfigNode
Get the name of the node.
Specified by:
getName in interface ConfigNode

getPath

public java.lang.String getPath()
Description copied from interface: ConfigNode
Get the complete path of the node.
Specified by:
getPath in interface ConfigNode

getParent

public ConfigNode getParent()
Description copied from interface: ConfigNode
Get the node above.
Specified by:
getParent in interface ConfigNode

getBoolean

public boolean getBoolean()
Description copied from interface: ConfigNode
Get value as a boolean.
Specified by:
getBoolean in interface ConfigNode

getInt

public int getInt()
Description copied from interface: ConfigNode
Get value as an integer.
Specified by:
getInt in interface ConfigNode

getDouble

public double getDouble()
Description copied from interface: ConfigNode
Get value as a double.
Specified by:
getDouble in interface ConfigNode

getString

public java.lang.String getString()
Description copied from interface: ConfigNode
Get value as String.
Specified by:
getString in interface ConfigNode

getBoolean

public boolean getBoolean(java.lang.String path,
                          boolean deflt)
Description copied from interface: ConfigNode
Get value of subnode as boolean, using default if necessary.
Specified by:
getBoolean in interface ConfigNode

getInt

public int getInt(java.lang.String path,
                  int deflt)
Description copied from interface: ConfigNode
Get value of subnode as integer, using default when necessary.
Specified by:
getInt in interface ConfigNode

getDouble

public double getDouble(java.lang.String path,
                        double deflt)
Description copied from interface: ConfigNode
Get value of subnode as double, using default when necessary.
Specified by:
getDouble in interface ConfigNode

getString

public java.lang.String getString(java.lang.String path,
                                  java.lang.String deflt)
Description copied from interface: ConfigNode
Get value of subnode as String, using default when necessary.
Specified by:
getString in interface ConfigNode

getInhBoolean

public boolean getInhBoolean(java.lang.String path,
                             boolean deflt)
Description copied from interface: ConfigNode
Get value of subnode as boolean searching parent nodes before using default.
Specified by:
getInhBoolean in interface ConfigNode

getInhInt

public int getInhInt(java.lang.String path,
                     int deflt)
Description copied from interface: ConfigNode
Get value of subnode as int searching parent nodes before using default.
Specified by:
getInhInt in interface ConfigNode

getInhDouble

public double getInhDouble(java.lang.String path,
                           double deflt)
Description copied from interface: ConfigNode
Get value of subnode as double searching parent nodes before using default.
Specified by:
getInhDouble in interface ConfigNode

getInhString

public java.lang.String getInhString(java.lang.String path,
                                     java.lang.String deflt)
Description copied from interface: ConfigNode
Get value of subnode as String searching parent nodes before using default.
Specified by:
getInhString in interface ConfigNode

countChildren

public int countChildren()
Description copied from interface: ConfigNode
Count the number of children we have.
Specified by:
countChildren in interface ConfigNode

children

public java.util.Iterator children()
Description copied from interface: ConfigNode
Enumerate my children.
Specified by:
children in interface ConfigNode

childrenNamed

public java.util.Iterator childrenNamed(java.lang.String key)
Description copied from interface: ConfigNode
Enumerate children of me, having a certain name.
Specified by:
childrenNamed in interface ConfigNode

countChildrenNamed

public int countChildrenNamed(java.lang.String key)
Description copied from interface: ConfigNode
Count the number of children we have.
Specified by:
countChildrenNamed in interface ConfigNode

print

public void print(java.io.PrintWriter os)
           throws java.io.IOException
Description copied from interface: ConfigNode
Pretty print this node with its whole subtree.
Specified by:
print in interface ConfigNode

More information