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

Class edu.cornell.lassp.mck10.ConfigurePack.ConfigurableBoolean

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

public class ConfigurableBoolean
extends Configurable

ConfigurableBoolean extends the Configurable class to contain an boolean 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. ConfigurableBoolean 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 ConfigurableBoolean(boolean)

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

 o ConfigurableBoolean(boolean, String, String)

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

 o ConfigurableBoolean(ConfigurableCollection, String, String, int, boolean)

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

 o ConfigurableBoolean(ConfigurableCollection, String, String, int, String)

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

Method Index

 o booleanValue()

The intValue() method of ConfigurableInteger returns the value of the ConfigurableInteger as an int.

 o set(String)

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

 o set(boolean)

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

 o toString()

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

Constructors

 o ConfigurableBoolean
  public ConfigurableBoolean(boolean value)

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

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

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

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

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

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

This constructor is used to create a full-fledged ConfigurableInteger 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 ConfigurableInteger
longName - The long name of the ConfigurableInteger
att - The attributes of the ConfigurableInteger
defaultVal - The default value of the ConfigurableInteger

Methods

 o set
  public boolean set(String value)

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

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

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

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

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

Returns:
A string containing the vlaue of the ConfigurableInteger
Overrides:
toString in class Configurable
 o booleanValue
  public boolean booleanValue()

The intValue() method of ConfigurableInteger returns the value of the ConfigurableInteger as an int.

Returns:
A Integer containing the value of the ConfigurableInteger.

All Packages  Class Hierarchy  This Package  Previous  Next  Index