|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.spieleck.config.ConfigSafeNode
An implementation of config node, that does not allow the client to proceed upwards in the configuration tree. XXX This is not well thought out, just thinking in code! This is not at all memory efficient, since the Safe nodes can actually multiply the original tree.
Inner Class Summary | |
protected static class |
ConfigSafeNode.SafeIterator
Wrapper class to return only safe ConfigNodes |
Field Summary | |
protected ConfigNode |
cn
|
protected ConfigNode |
root
|
Constructor Summary | |
ConfigSafeNode(ConfigNode cn)
Wrap this node in a safe one. |
|
ConfigSafeNode(ConfigNode cn,
ConfigNode root)
Wrap a node into a safe one and prescibe a root. |
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. |
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 |
Field Detail |
protected ConfigNode root
protected ConfigNode cn
Constructor Detail |
public ConfigSafeNode(ConfigNode cn)
public ConfigSafeNode(ConfigNode cn, ConfigNode root)
Method Detail |
public ConfigNode node(java.lang.String path)
ConfigNode
node
in interface ConfigNode
public ConfigNode nodeInh(java.lang.String path)
ConfigNode
nodeInh
in interface ConfigNode
public ConfigFileNode getBranchNode()
ConfigNode
getBranchNode
in interface ConfigNode
public java.lang.String getName()
ConfigNode
getName
in interface ConfigNode
public java.lang.String getPath()
ConfigNode
getPath
in interface ConfigNode
public ConfigNode getParent()
ConfigNode
getParent
in interface ConfigNode
public boolean getBoolean()
ConfigNode
getBoolean
in interface ConfigNode
public int getInt()
ConfigNode
getInt
in interface ConfigNode
public double getDouble()
ConfigNode
getDouble
in interface ConfigNode
public java.lang.String getString()
ConfigNode
getString
in interface ConfigNode
public boolean getBoolean(java.lang.String path, boolean deflt)
ConfigNode
getBoolean
in interface ConfigNode
public int getInt(java.lang.String path, int deflt)
ConfigNode
getInt
in interface ConfigNode
public double getDouble(java.lang.String path, double deflt)
ConfigNode
getDouble
in interface ConfigNode
public java.lang.String getString(java.lang.String path, java.lang.String deflt)
ConfigNode
getString
in interface ConfigNode
public boolean getInhBoolean(java.lang.String path, boolean deflt)
ConfigNode
getInhBoolean
in interface ConfigNode
public int getInhInt(java.lang.String path, int deflt)
ConfigNode
getInhInt
in interface ConfigNode
public double getInhDouble(java.lang.String path, double deflt)
ConfigNode
getInhDouble
in interface ConfigNode
public java.lang.String getInhString(java.lang.String path, java.lang.String deflt)
ConfigNode
getInhString
in interface ConfigNode
public int countChildren()
ConfigNode
countChildren
in interface ConfigNode
public java.util.Iterator children()
ConfigNode
children
in interface ConfigNode
public java.util.Iterator childrenNamed(java.lang.String key)
ConfigNode
childrenNamed
in interface ConfigNode
public int countChildrenNamed(java.lang.String key)
ConfigNode
countChildrenNamed
in interface ConfigNode
public void print(java.io.PrintWriter os) throws java.io.IOException
ConfigNode
print
in interface ConfigNode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |