All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.util.Observable | +----edu.cornell.lassp.mck10.ConfigurePack.Configurable | +----edu.cornell.lassp.mck10.ConfigurePack.ConfigurableCollection
ConfigurableCollection is a subclass of Configurable used to create trees of configurable variables. A ConfigurableCollection must be passed to each new Configurable variable in its constructor, in order to give the new variable a place in a tree. If no ConfigurableCollection is passed, the new variable will stand on its own, and will lack much of the functionality of a Configurable in a tree. Trees created with ConfigurableCollections do a number of things:
root.set("unique.name=value")
or
subTree.set("child.name=value")
.
If a ConfigurableCollection is created without a parent, it will be
the root of its tree. If the root is passed an Applet (for PARAM tags),
or an argv[]
array (for command-line parameters), or a
configuration file, it will try to provide default values for the
variables in its tree. Otherwise, it will be a "dead" root, and it
will not try to provide these services for its children.
ConfigurableCollection provides several non-public methods which are called by a collection's children:
The get(String) command is used to get the value of a variable in the ConfigurableCollections subtree.
The outputParams() method returns a string containing Param tags to set an entire subTree.
ConfigurableCollection
, the set(String)
method is implemented with logic for setting the values of the
collection's children.
set(String)
method will
set all of the variables in the ConfigurableCollection's sub-tree.
public ConfigurableCollection(ConfigurableCollection parent, String shortName, String longName, int att)
null
for
its default value.
public ConfigurableCollection(Applet params, String shortName, String longName, int att)
public boolean set(String val)
ConfigurableCollection
, the set(String)
method is implemented with logic for setting the values of the
collection's children. The syntax is
set("childName = value")
.
protected boolean set(String name, String value)get
public String get(String name)
The get(String) command is used to get the value of a variable in the ConfigurableCollections subtree. The syntax is get("unique.name");
public String toString()
set(String)
method will
set all of the variables in the ConfigurableCollection's sub-tree.
It makes use of the protected method toString(String)
, which
takes as its parameter the name of the parent tree, so that the names
can be coded properly.
protected String toString(String parentName)addConfigurable
public void addConfigurable(Configurable child)removeConfigurable
public void removeConfigurable(Configurable child)outputParams
public String outputParams()
The outputParams() method returns a string containing Param tags to set an entire subTree.
protected Frame newFrame()
public void hideFrames()
All Packages Class Hierarchy This Package Previous Next Index