net.sourceforge.dvb.projectx.common
Class Settings

java.lang.Object
  |
  +--net.sourceforge.dvb.projectx.common.Settings

public class Settings
extends java.lang.Object

The Settings class handles the settings for Project-X.


Constructor Summary
Settings()
          Constructor
Settings(java.lang.String filename)
          Constructor
 
Method Summary
 java.lang.String addInputDirectory(java.lang.Object value)
          adds input_directory Xinput object
 void addOutputDirectory(java.lang.Object value)
          adds output_directory string
 void addOutputDirectory(java.lang.Object value, int index)
          adds output_directory string
 void buildInputDirectories()
          build input_directory Xinput object from property list (strings only)
 void buildOutputDirectories()
          build output_directory from property list (strings only)
 java.lang.Boolean getBooleanProperty(java.lang.String key)
          Returns a Boolean property.
 boolean getBooleanProperty(java.lang.String[] key_defaultValue)
          Returns a Boolean property or the given defaultValue.
 boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
          Returns a Boolean property or the given defaultValue.
 java.util.Map getHashMapProperty(java.lang.String key)
          Gets a Map of properties starting with key.
 java.lang.String getInifile()
          Returns the ini filename.
 java.util.ArrayList getInputDirectories()
          returns input_directory Xinput objects
 int getIntProperty(java.lang.String key)
          Returns an integer property.
 int getIntProperty(java.lang.String[] key_defaultValue)
          Returns an integer property.
 int getIntProperty(java.lang.String key, int defaultValue)
          Returns an integer property.
 java.util.List getListProperty(java.lang.String key)
          Gets a List of properties starting with key.
 java.util.ArrayList getOutputDirectories()
          returns output_directory strings
 java.lang.String getProperty(java.lang.String key)
          Returns a String property.
 java.lang.String getProperty(java.lang.String[] key_defaultValue)
          Returns a String property.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns a String property.
 void load()
          Loads the ini file.
 void loadProperties(java.io.ByteArrayInputStream is)
           
 void remove(java.lang.String key)
          Removes a property.
 void removeInputDirectory(int index)
          removes input_directory Xinput object
 void removeListProperty(java.lang.String key)
          removes a List of properties starting with key.
 void removeOutputDirectory(int index)
          removes output_directory string
 void save()
          Saves the ini file.
 void save(java.lang.String str)
          Saves the ini file (std or extra name)
 void setBooleanProperty(java.lang.String key, boolean value)
          Returns a boolean property.
 void setHashMapProperty(java.lang.String key, java.util.Map map)
          Sets a Map of properties starting with key.
 void setIntProperty(java.lang.String key, int value)
          Returns an integer property.
 void setListProperty(java.lang.String key, java.util.List list)
          Sets a List of properties starting with key.
 void setProperty(java.lang.Object[] key, java.lang.Object value)
          Sets a Object property.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets a Object property.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a String property.
 byte[] storeProperties()
           
 void updateInputDirectories()
          updates property list (strings only)
 void updateOutputDirectories()
          updates property list (strings only)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
Constructor

Settings

public Settings(java.lang.String filename)
Constructor
Parameters:
filename -  
Method Detail

loadProperties

public void loadProperties(java.io.ByteArrayInputStream is)
                    throws java.io.IOException

storeProperties

public byte[] storeProperties()
                       throws java.io.IOException

load

public void load()
Loads the ini file.

save

public void save()
Saves the ini file.

save

public void save(java.lang.String str)
Saves the ini file (std or extra name)

buildInputDirectories

public void buildInputDirectories()
build input_directory Xinput object from property list (strings only)

updateInputDirectories

public void updateInputDirectories()
updates property list (strings only)

addInputDirectory

public java.lang.String addInputDirectory(java.lang.Object value)
adds input_directory Xinput object

removeInputDirectory

public void removeInputDirectory(int index)
removes input_directory Xinput object

getInputDirectories

public java.util.ArrayList getInputDirectories()
returns input_directory Xinput objects

buildOutputDirectories

public void buildOutputDirectories()
build output_directory from property list (strings only)

updateOutputDirectories

public void updateOutputDirectories()
updates property list (strings only)

addOutputDirectory

public void addOutputDirectory(java.lang.Object value)
adds output_directory string

addOutputDirectory

public void addOutputDirectory(java.lang.Object value,
                               int index)
adds output_directory string

removeOutputDirectory

public void removeOutputDirectory(int index)
removes output_directory string

getOutputDirectories

public java.util.ArrayList getOutputDirectories()
returns output_directory strings

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets a String property.
Parameters:
key -  
value -  
Returns:
 

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Sets a Object property.
Parameters:
key -  
value -  
Returns:
 

setProperty

public void setProperty(java.lang.Object[] key,
                        java.lang.Object value)
Sets a Object property.
Parameters:
key - of obj
value -  
Returns:
 

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns a String property.
Parameters:
key -  
Returns:
 

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Returns a String property. If not found it returns the given default value.
Parameters:
key -  
defaultValue -  
Returns:
 

getProperty

public java.lang.String getProperty(java.lang.String[] key_defaultValue)
Returns a String property. If not found it returns the given default value.
Parameters:
key -  
defaultValue -  
Returns:
 

setIntProperty

public void setIntProperty(java.lang.String key,
                           int value)
Returns an integer property.
Parameters:
key -  
value -  
Returns:
 

getIntProperty

public int getIntProperty(java.lang.String key)
Returns an integer property.
Parameters:
key -  
Returns:
 

getIntProperty

public int getIntProperty(java.lang.String key,
                          int defaultValue)
Returns an integer property. If not found or not parseable it returns the default value.
Parameters:
key -  
defaultValue -  
Returns:
 

getIntProperty

public int getIntProperty(java.lang.String[] key_defaultValue)
Returns an integer property. If not found or not parseable it returns the default value.
Parameters:
key -  
defaultValue -  
Returns:
 

setBooleanProperty

public void setBooleanProperty(java.lang.String key,
                               boolean value)
Returns a boolean property. Default is false.
Parameters:
key -  
Returns:
 

getBooleanProperty

public java.lang.Boolean getBooleanProperty(java.lang.String key)
Returns a Boolean property. Null if key not found. Default is false.
Parameters:
key -  
Returns:
 

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key,
                                  boolean defaultValue)
Returns a Boolean property or the given defaultValue.
Parameters:
key -  
defaultValue -  
Returns:
 

getBooleanProperty

public boolean getBooleanProperty(java.lang.String[] key_defaultValue)
Returns a Boolean property or the given defaultValue.
Parameters:
key -  
defaultValue -  
Returns:
 

setListProperty

public void setListProperty(java.lang.String key,
                            java.util.List list)
Sets a List of properties starting with key.
Parameters:
key -  
list -  
Returns:
 

getListProperty

public java.util.List getListProperty(java.lang.String key)
Gets a List of properties starting with key.
Parameters:
key -  
Returns:
 

removeListProperty

public void removeListProperty(java.lang.String key)
removes a List of properties starting with key.
Parameters:
key -  
Returns:
 

setHashMapProperty

public void setHashMapProperty(java.lang.String key,
                               java.util.Map map)
Sets a Map of properties starting with key.
Parameters:
key -  
map -  
Returns:
 

getHashMapProperty

public java.util.Map getHashMapProperty(java.lang.String key)
Gets a Map of properties starting with key. The Map contains the entries with a new key like this: mapKey = propsKey - key.
Parameters:
key -  
Returns:
 

remove

public void remove(java.lang.String key)
Removes a property.
Parameters:
key -  

getInifile

public java.lang.String getInifile()
Returns the ini filename.
Returns: