net.javamud.data
Class PersistentProperties

java.lang.Object
  |
  +--net.javamud.data.PersistentProperties
All Implemented Interfaces:
Persisted

public class PersistentProperties
extends Object
implements Persisted

Hierarchical Properties for independant storage and retrieval. A property is a key-value pair. The keys are always Strings. The values can be Strings, other PersistentProperties, PersistentSets, or PersistentObjects.

Author:
Timothy Hinchcliffe
Created On:
11 May 2002

Field Summary
protected  Map bag
          Storage for the Properties
 
Constructor Summary
PersistentProperties()
          Constructor for the PersistentProperties object
 
Method Summary
 boolean contains(String key)
          Returns true if the PersistentProperties contains key .
 PersistentProperties getPersistentProperties(String key)
          Gets the mudProperties attribute of the PersistentProperties object
 Object getProperty(String key)
          Gets the property attribute of the PersistentProperties object
 String getString(String key)
          Gets the string attribute of the PersistentProperties object
 boolean isString(String key)
          Returns TRUE if the value associated with key is a String.
 Iterator iterator()
          Returns an Iterator for the key values.
 Object remove(String key)
          Description of the Method
 void setProperty(String key, PersistentObject value)
          Sets the PersistentProperties property key to value
 void setProperty(String key, PersistentProperties value)
          Sets the PersistentProperties property key to value
 void setProperty(String key, PersistentSet value)
          Sets the PersistentProperties property key to value
 void setProperty(String key, String value)
          Sets the String property key to value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bag

protected Map bag
Storage for the Properties

Constructor Detail

PersistentProperties

public PersistentProperties()
Constructor for the PersistentProperties object

Method Detail

contains

public boolean contains(String key)
Returns true if the PersistentProperties contains key .

Parameters:
key - Key to check for.
Returns:
If key exists in collection.

getPersistentProperties

public PersistentProperties getPersistentProperties(String key)
Gets the mudProperties attribute of the PersistentProperties object

Parameters:
key - Description of the Parameter
Returns:
The mudProperties value

getProperty

public Object getProperty(String key)
Gets the property attribute of the PersistentProperties object

Parameters:
key - Description of the Parameter
Returns:
The property value

getString

public String getString(String key)
Gets the string attribute of the PersistentProperties object

Parameters:
key - Description of the Parameter
Returns:
The string value

isString

public boolean isString(String key)
Returns TRUE if the value associated with key is a String.

Parameters:
key - Key of value to test.
Returns:
If value is a string or not.

iterator

public Iterator iterator()
Returns an Iterator for the key values. Iterator.remove will remove the property.

Returns:
Iterator of keys.

remove

public Object remove(String key)
Description of the Method

Parameters:
key - Description of the Parameter
Returns:
Description of the Return Value

setProperty

public void setProperty(String key,
                        String value)
Sets the String property key to value

Parameters:
key - The key to set
value - The value to set

setProperty

public void setProperty(String key,
                        PersistentProperties value)
Sets the PersistentProperties property key to value

Parameters:
key - The key to set
value - The value to set

setProperty

public void setProperty(String key,
                        PersistentObject value)
Sets the PersistentProperties property key to value

Parameters:
key - The key to set
value - The value to set

setProperty

public void setProperty(String key,
                        PersistentSet value)
Sets the PersistentProperties property key to value

Parameters:
key - The key to set
value - The value to set