Class edu.cornell.lassp.mck10.ConfigurePack.ConfigurableDouble
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cornell.lassp.mck10.ConfigurePack.ConfigurableDouble

java.lang.Object
   |
   +----java.util.Observable
           |
           +----edu.cornell.lassp.mck10.ConfigurePack.Configurable
                   |
                   +----edu.cornell.lassp.mck10.ConfigurePack.ConfigurableDouble

public class ConfigurableDouble
extends Configurable

ConfigurableDouble extends the Configurable class to contain a double variable, and provides new methods for the world to interface with that variable. It overrides the set(String) methods and the toString() methods of Configurable. ConfigurableDouble is also set up to be an observable. Source code is available.

Version:
0.1
Author:
Matt Kuntz (E-mail: mck10@cornell.edu)
See Also:
Configurable

Constructor Index

 o ConfigurableDouble(double)

This constructor allows a ConfigurableDouble to be constructed which exists outside the Configurable heirarchy and does not use its configurable functionality.

 o ConfigurableDouble(double, String, String)

This constructor allows a ConfigurableDouble to be constructed outside of the tree structure, but with short and long names.

 o ConfigurableDouble(ConfigurableCollection, String, String, int, double)

This constructor is used to create a full-fledged ConfigurableDouble with all of the functionality of a Configurable.

 o ConfigurableDouble(ConfigurableCollection, String, String, int, String)

This constructor is used to create a full-fledged ConfigurableDouble with all of the functionality of a Configurable.

Method Index

 o doubleValue()

The doubleValue() method of ConfigurableDouble returns the value of the ConfigurableDouble as a double.

 o set(String)

The set(String) method of ConfigurableDouble takes a string as its argument, (e.g.

 o set(double)

We often will want to set the value of our ConfigurableDouble using a double, rather than a string, so we provide a set(double) method.

 o toString()

The toString() method of ConfigurableDouble returns a string representing the value of the ConfigurableDouble.

Constructors

 o ConfigurableDouble
  public ConfigurableDouble(double value)

This constructor allows a ConfigurableDouble to be constructed which exists outside the Configurable heirarchy and does not use its configurable functionality.

Parameters:
value - The initial value of the ConfigurableDouble
 o ConfigurableDouble
  public ConfigurableDouble(double value,
                            String shortName,
                            String longName)

This constructor allows a ConfigurableDouble to be constructed outside of the tree structure, but with short and long names.

Parameters:
value - The initial value of the ConfigurableDouble
shortName - The short name of the ConfigurableDouble
longName - The long name of the ConfigurableDouble
 o ConfigurableDouble
  public ConfigurableDouble(ConfigurableCollection parent,
                            String shortName,
                            String longName,
                            int att,
                            double defaultVal)

This constructor is used to create a full-fledged ConfigurableDouble with all of the functionality of a Configurable. It takes a double default value, rather than a String.

Parameters:
parent - A reference to the parent ConfigurableCollection
shortName - The short name of the ConfigurableDouble
longName - The long name of the ConfigurableDouble
att - The attributes of the ConfigurableDouble
defaultVal - The default value of the ConfigurableDouble
 o ConfigurableDouble
  public ConfigurableDouble(ConfigurableCollection parent,
                            String shortName,
                            String longName,
                            int att,
                            String defaultVal)

This constructor is used to create a full-fledged ConfigurableDouble with all of the functionality of a Configurable. It takes a String to set the default value.

Parameters:
parent - A reference to the parent ConfigurableCollection
shortName - The short name of the ConfigurableDouble
longName - The long name of the ConfigurableDouble
att - The attributes of the ConfigurableDouble
defaultVal - The default value of the ConfigurableDouble

Methods

 o set
  public boolean set(String value)

The set(String) method of ConfigurableDouble takes a string as its argument, (e.g. "0.5 E 15") and uses it to set the value of the ConfigurableDouble. Observers will be notified of the change.

Parameters:
value - The value to set the ConfigurableDouble to.
Returns:
true is returned if the set is successful, false if unsuccessful.
Overrides:
set in class Configurable
 o set
  public void set(double value)

We often will want to set the value of our ConfigurableDouble using a double, rather than a string, so we provide a set(double) method. Observers are notified of the change in value.

Parameters:
value - The value to set the ConfigurableDouble to
 o toString
  public String toString()

The toString() method of ConfigurableDouble returns a string representing the value of the ConfigurableDouble.

Returns:
A string containing the vlaue of the ConfigurableDouble
Overrides:
toString in class Configurable
 o doubleValue
  public double doubleValue()

The doubleValue() method of ConfigurableDouble returns the value of the ConfigurableDouble as a double.

Returns:
A double containing the value of the ConfigurableDouble.

All Packages  Class Hierarchy  This Package  Previous  Next  Index