dragon.config
Class BasicConfigureNode

java.lang.Object
  |
  +--dragon.config.BasicConfigureNode
All Implemented Interfaces:
ConfigureNode

public class BasicConfigureNode
extends java.lang.Object
implements ConfigureNode

Basic data structure for XML configure node

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Constructor Summary
BasicConfigureNode(org.w3c.dom.Node node)
           
BasicConfigureNode(java.lang.String configFile)
           
 
Method Summary
 boolean exist(java.lang.String key)
           
 boolean getBoolean(java.lang.String key)
           
 boolean getBoolean(java.lang.String key, boolean def)
           
 double getDouble(java.lang.String key)
           
 double getDouble(java.lang.String key, double def)
           
 ConfigureNode getFirstChild()
          Gets the first object node within the current configuration node
 int getInt(java.lang.String key)
           
 int getInt(java.lang.String key, int def)
           
 ConfigureNode getNextSibling()
          Gets the next object node in parallel to the current onfiguration node
 java.lang.Class getNodeClass()
           
 int getNodeID()
           
 java.lang.String getNodeName()
           
 java.lang.String getNodeType()
           
 java.lang.String getParameterType(java.lang.String key)
          If the parameter corresponds to an object, it returns the type (usually the interface) of the object.
 ConfigureNode getParentNode()
          Gets the parent node of the current object node
 java.lang.String getString(java.lang.String key)
           
 java.lang.String getString(java.lang.String key, java.lang.String def)
          If the given parameter exists, return its values, otherwise return the default value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicConfigureNode

public BasicConfigureNode(java.lang.String configFile)

BasicConfigureNode

public BasicConfigureNode(org.w3c.dom.Node node)
Method Detail

getParentNode

public ConfigureNode getParentNode()
Description copied from interface: ConfigureNode
Gets the parent node of the current object node

Specified by:
getParentNode in interface ConfigureNode
Returns:
the parent node of the current object node

getFirstChild

public ConfigureNode getFirstChild()
Description copied from interface: ConfigureNode
Gets the first object node within the current configuration node

Specified by:
getFirstChild in interface ConfigureNode
Returns:
the first object node within the current configuration node

getNextSibling

public ConfigureNode getNextSibling()
Description copied from interface: ConfigureNode
Gets the next object node in parallel to the current onfiguration node

Specified by:
getNextSibling in interface ConfigureNode
Returns:
the next object node in parallel to the current onfiguration node

getNodeName

public java.lang.String getNodeName()
Specified by:
getNodeName in interface ConfigureNode
Returns:
the name of the object node

getNodeID

public int getNodeID()
Specified by:
getNodeID in interface ConfigureNode
Returns:
the id of the object node

getNodeClass

public java.lang.Class getNodeClass()
Specified by:
getNodeClass in interface ConfigureNode
Returns:
the class name the object corresponds to

getNodeType

public java.lang.String getNodeType()
Specified by:
getNodeType in interface ConfigureNode
Returns:
the type of the object node

getString

public java.lang.String getString(java.lang.String key)
Specified by:
getString in interface ConfigureNode

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String def)
Description copied from interface: ConfigureNode
If the given parameter exists, return its values, otherwise return the default value.

Specified by:
getString in interface ConfigureNode
Parameters:
key - the name of the parameter
def - the default value of the parameter
Returns:
the string of the parameter

getInt

public int getInt(java.lang.String key)
Specified by:
getInt in interface ConfigureNode

getInt

public int getInt(java.lang.String key,
                  int def)
Specified by:
getInt in interface ConfigureNode

getBoolean

public boolean getBoolean(java.lang.String key)
Specified by:
getBoolean in interface ConfigureNode

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean def)
Specified by:
getBoolean in interface ConfigureNode

getDouble

public double getDouble(java.lang.String key)
Specified by:
getDouble in interface ConfigureNode

getDouble

public double getDouble(java.lang.String key,
                        double def)
Specified by:
getDouble in interface ConfigureNode

exist

public boolean exist(java.lang.String key)
Specified by:
exist in interface ConfigureNode
Parameters:
key - the name of the parameter
Returns:
true if the parameter exists

getParameterType

public java.lang.String getParameterType(java.lang.String key)
Description copied from interface: ConfigureNode
If the parameter corresponds to an object, it returns the type (usually the interface) of the object. Otherwise, it returns null.

Specified by:
getParameterType in interface ConfigureNode
Parameters:
key - the name of the parameter
Returns:
the type of the object