Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.stanford.genetics.treeview
Interface ConfigNode  view ConfigNode download ConfigNode.java

All Known Implementing Classes:
DummyConfigNode, XmlConfig.XmlConfigNode

public interface ConfigNode

Defines an interface for storage of key-value pairs. Essentially all the configuration information for Java TreeView is stored using this interface. You will encounter two implementing classes. The first, most common one is an inner class of XmlConfig, which simply presents an interface to edit an xml document. Thus, when you mess with that inner class through this interface, you're actually writing XML. The second is the DummyConfigNode, which you can use for prototyping stuff or if you just want to use this interface to store key-value pairs in a non-persistant fashion. The easiest way to make an object persistant across different runs of the program is to bind it to a ConfigNode returned by XmlConfig (which is bound to a file on disk), and then just store all state informaion in the ConfigNode. Whenever the XmlConfig is saved, it will automatically save the state of your object. just make sure you save it before you exit!

Version:
$Revision: 1.3 $ $Date: 2003/06/23 08:03:07 $

Method Summary
 ConfigNode create(java.lang.String name)
          create and return a subnode which has the indicated name
 ConfigNode[] fetch(java.lang.String name)
          fetch all nodes with the name
 ConfigNode fetchFirst(java.lang.String string)
          fetch first node by name
 double getAttribute(java.lang.String string, double d)
          get a double attribute
 int getAttribute(java.lang.String string, int i)
          get an int attribute
 java.lang.String getAttribute(java.lang.String string1, java.lang.String string2)
          get a String attribute
 boolean hasAttribute(java.lang.String string)
          determine if a particular attribute is defined for this node.
 void remove(ConfigNode configNode)
          remove particular subnode
 void removeAll(java.lang.String string)
          remove all subnodes with a given name
 void setAttribute(java.lang.String att, double val, double dval)
          set a double attribute
 void setAttribute(java.lang.String att, int val, int dval)
          set an int attribute
 void setAttribute(java.lang.String att, java.lang.String val, java.lang.String dval)
          set a String attribute
 void setLast(ConfigNode configNode)
          set attribute to be last in list
 

Method Detail

create

public ConfigNode create(java.lang.String name)
create and return a subnode which has the indicated name


fetch

public ConfigNode[] fetch(java.lang.String name)
fetch all nodes with the name


fetchFirst

public ConfigNode fetchFirst(java.lang.String string)
fetch first node by name


remove

public void remove(ConfigNode configNode)
remove particular subnode


removeAll

public void removeAll(java.lang.String string)
remove all subnodes with a given name


setLast

public void setLast(ConfigNode configNode)
set attribute to be last in list


hasAttribute

public boolean hasAttribute(java.lang.String string)
determine if a particular attribute is defined for this node.


getAttribute

public double getAttribute(java.lang.String string,
                           double d)
get a double attribute


getAttribute

public int getAttribute(java.lang.String string,
                        int i)
get an int attribute


getAttribute

public java.lang.String getAttribute(java.lang.String string1,
                                     java.lang.String string2)
get a String attribute


setAttribute

public void setAttribute(java.lang.String att,
                         double val,
                         double dval)
set a double attribute


setAttribute

public void setAttribute(java.lang.String att,
                         int val,
                         int dval)
set an int attribute


setAttribute

public void setAttribute(java.lang.String att,
                         java.lang.String val,
                         java.lang.String dval)
set a String attribute