org.jscience.architecture.traffic
Interface Settings

All Superinterfaces:
XMLSerializable
All Known Implementing Classes:
GeneralSettings

public interface Settings
extends XMLSerializable

General interface for classes which hold settings


Method Summary
 void doLoad()
          Load settings from settings file
 void doSave()
          Save settings to settings file
 boolean getPropertyBooleanValue(java.lang.String name)
          Gets the value of a boolean property
 float getPropertyFloatValue(java.lang.String name)
          Gets the value of a float property
 int getPropertyIntValue(java.lang.String name)
          Gets the value of an int property
 java.lang.String getPropertyStringValue(java.lang.String name)
          Gets the String value of a certain property
 boolean isPredefined()
          Indicates if this Settings are predefined.
 void setProperty(java.lang.String name, boolean value)
          Set a boolean property to a certain value
 void setProperty(java.lang.String name, int value)
          Set an int property to a certain value
 void setProperty(java.lang.String name, java.lang.String value)
          Set a string property to a certain value
 
Methods inherited from interface org.jscience.architecture.traffic.xml.XMLSerializable
getXMLName, load, saveChilds, saveSelf, setParentName
 

Method Detail

doLoad

void doLoad()
            throws java.io.IOException,
                   XMLTreeException,
                   XMLInvalidInputException
Load settings from settings file

Throws:
java.io.IOException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

doSave

void doSave()
            throws java.io.IOException,
                   XMLTreeException,
                   XMLCannotSaveException
Save settings to settings file

Throws:
java.io.IOException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

isPredefined

boolean isPredefined()
Indicates if this Settings are predefined. If so, then the user cannot add new properties to this object. So, in that case, it is not possible to do a setProperty with a name that does not exist yet. So it is OK to change existing properties of a predefined settings object, but you cannot add new properties.

Returns:
DOCUMENT ME!

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value)
                 throws java.util.NoSuchElementException
Set a string property to a certain value

Parameters:
name - The name of the property
value - The new value of the property
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

setProperty

void setProperty(java.lang.String name,
                 int value)
                 throws java.util.NoSuchElementException
Set an int property to a certain value

Parameters:
name - The name of the property
value - The new value of the property
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

setProperty

void setProperty(java.lang.String name,
                 boolean value)
                 throws java.util.NoSuchElementException
Set a boolean property to a certain value

Parameters:
name - The name of the property
value - The new value of the property
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

getPropertyStringValue

java.lang.String getPropertyStringValue(java.lang.String name)
                                        throws java.util.NoSuchElementException
Gets the String value of a certain property

Parameters:
name - The name of the property
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - if there is no property with that name

getPropertyIntValue

int getPropertyIntValue(java.lang.String name)
                        throws java.util.NoSuchElementException
Gets the value of an int property

Parameters:
name - The name of the property
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - if there is no property with that name

getPropertyBooleanValue

boolean getPropertyBooleanValue(java.lang.String name)
                                throws java.util.NoSuchElementException
Gets the value of a boolean property

Parameters:
name - The name of the property
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - if there is no property with that name

getPropertyFloatValue

float getPropertyFloatValue(java.lang.String name)
                            throws java.util.NoSuchElementException
Gets the value of a float property

Parameters:
name - The name of the property
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - if there is no property with that name