misim.util
Class Setting
java.lang.Object
|
+--misim.util.Setting
- public class Setting
- extends java.lang.Object
A Setting represents a name value pair that may be stored and read
from a file by a SettingsController.
Constructor Summary |
Setting(java.lang.String settingName,
java.lang.String settingValue)
Constructor. |
Method Summary |
boolean |
getBoolean()
Return a boolean value for this setting. |
int |
getIntValue()
Try to return an integer value for this setting |
java.lang.String |
getName()
Get the name of this setting |
java.lang.String |
getValue()
Get the value of this setting |
void |
setValue(java.lang.String newValue)
Set the value for this setting |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Setting
public Setting(java.lang.String settingName,
java.lang.String settingValue)
- Constructor. Create a setting with the given name and value.
Note that the name is case sensitive
- Parameters:
settingName
- The name of the setting to createsettingValue
- The value of the setting to create
getName
public java.lang.String getName()
- Get the name of this setting
- Returns:
- The name of this setting
getValue
public java.lang.String getValue()
- Get the value of this setting
- Returns:
- The value of this setting
getIntValue
public int getIntValue()
throws java.lang.NumberFormatException
- Try to return an integer value for this setting
- Returns:
- The integer value for this setting
- Throws:
java.lang.NumberFormatException
- if the value is not a valid integer
getBoolean
public boolean getBoolean()
- Return a boolean value for this setting. This returns true
if the setting has a value of 'true' (case is not important),
and returns false otherwise.
- Returns:
- The boolean value for this setting
setValue
public void setValue(java.lang.String newValue)
- Set the value for this setting
- Parameters:
newValue
- The new value for this setting