com.tensegrity.generic.util
Class NonPersistentProperties

java.lang.Object
  extended bycom.tensegrity.generic.util.Properties
      extended bycom.tensegrity.generic.util.NonPersistentProperties
All Implemented Interfaces:
PropertiesFile

public class NonPersistentProperties
extends com.tensegrity.generic.util.Properties

Derivation of Properties to remove the persistence. Useful for situations where the application does not have the right to load and save files (e.g. applet context)

Author:
BurkhardWick

Constructor Summary
NonPersistentProperties()
          Constructor
 
Method Summary
protected  void checkFile(java.io.File file)
          Overridden to do nothing, because we don't want to persist the data
 void clear()
          Clears the internal list of properties.
 java.lang.String getProperty(java.lang.String key)
          Returns the property string previously associated to the parameter key.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns the property string previously associated to the parameter key.
 java.util.Set keySet()
          Returns a set of keys.
 void load()
          Overridden to do nothing, because we don't want to persist the data
 java.lang.Object remove(java.lang.Object key)
          Removes a key and corresponding value from this PropertiesFile.
 void save(java.lang.String header)
          Overridden to do nothing, because we don't want to persist the data
 java.lang.String setProperty(java.lang.String key, java.lang.String value)
          Maps the specified key to the specified value in this PropertiesFile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonPersistentProperties

public NonPersistentProperties()
Constructor

Method Detail

save

public void save(java.lang.String header)
          throws java.io.IOException
Overridden to do nothing, because we don't want to persist the data

Throws:
java.io.IOException
See Also:
Properties.save(java.lang.String)

load

public void load()
          throws java.io.IOException
Overridden to do nothing, because we don't want to persist the data

Throws:
java.io.IOException
See Also:
Properties.load()

checkFile

protected void checkFile(java.io.File file)
Overridden to do nothing, because we don't want to persist the data

Parameters:
file - the file to check.
See Also:
Properties.checkFile(java.io.File)

clear

public void clear()
Description copied from interface: PropertiesFile
Clears the internal list of properties.

Specified by:
clear in interface PropertiesFile

getProperty

public java.lang.String getProperty(java.lang.String key)
Description copied from interface: PropertiesFile
Returns the property string previously associated to the parameter key. If no such property can be found null is returned.

Specified by:
getProperty in interface PropertiesFile
Parameters:
key - the key of a property.
Returns:
the string value associated with the parameter key.

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Description copied from interface: PropertiesFile
Returns the property string previously associated to the parameter key. If no such property can be found defaultValue is returned.

Specified by:
getProperty in interface PropertiesFile
Parameters:
key - the key of a property.
defaultValue - the value which should be returned if no value was associated with the given key.
Returns:
the string value associated with the parameter key.

setProperty

public java.lang.String setProperty(java.lang.String key,
                                    java.lang.String value)
Description copied from interface: PropertiesFile
Maps the specified key to the specified value in this PropertiesFile. Neither the key nor the value can be null. If there was no entry with that key yet, null is returned. Otherwise the previously mapped value is returned.

Specified by:
setProperty in interface PropertiesFile
Parameters:
key - the key for the property.
value - the value.
Returns:
the previous value to which the key was mapped in this dictionary, or null if the key did not have a previous mapping.

remove

public java.lang.Object remove(java.lang.Object key)
Description copied from interface: PropertiesFile
Removes a key and corresponding value from this PropertiesFile.

Specified by:
remove in interface PropertiesFile
Parameters:
key - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this PropertyFile, or null if the key did not have a mapping.

keySet

public java.util.Set keySet()
Description copied from interface: PropertiesFile
Returns a set of keys.

Specified by:
keySet in interface PropertiesFile
Returns:
a Set of the current keys of this PropertiesFile.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.