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

Class edu.cornell.lassp.mck10.ConfigurePack.ConfigurableInteger

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

public class ConfigurableInteger
extends Configurable

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

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

 o ConfigurableInteger(int, String, String)

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

 o ConfigurableInteger(ConfigurableCollection, String, String, int, int)

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

 o ConfigurableInteger(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 intValue()

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(int)

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 ConfigurableInteger
  public ConfigurableInteger(int value)

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

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

This constructor allows a ConfigurableInteger 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 ConfigurableInteger
  public ConfigurableInteger(ConfigurableCollection parent,
                             String shortName,
                             String longName,
                             int att,
                             int defaultVal)

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

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
 o ConfigurableInteger
  public ConfigurableInteger(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(int 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 intValue
  public int intValue()

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