com.borland.primetime.properties
Class MapProperty
java.lang.Object
|
+--com.borland.primetime.properties.Property
|
+--com.borland.primetime.properties.MapProperty
- All Implemented Interfaces:
- java.lang.Comparable
- public class MapProperty
- extends Property
Instances of MapProperty are used to represent settings in a temporary
storage structure. Property values may be copied to some more permanent
structure by external mechanisms.
Constructor Summary |
MapProperty(java.lang.String category,
java.lang.String name)
Create a new MapProperty with the specified category and property name. |
MapProperty(java.lang.String category,
java.lang.String name,
java.lang.String defaultValue)
Create a new MapProperty with the specified category, property name and
default value. |
Method Summary |
void |
addPropertyListener(MapPropertyListener listener)
Adds a MapPropertyListener to the list of listeners that receive events. |
void |
firePropertyChange(java.util.Map map,
java.lang.String oldValue,
java.lang.String newValue)
Notifies all registered MapPropertyListeners that the value of the
property has been changed. |
java.lang.String |
getValue(java.util.Map map)
Fetches current value for this property. |
void |
removePropertyListener(MapPropertyListener listener)
Removes a MapPropertyListener from the list of listeners that receive
events. |
boolean |
setValue(java.util.Map map,
java.lang.String value)
Set value for this property. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
defaultValue
protected java.lang.String defaultValue
MapProperty
public MapProperty(java.lang.String category,
java.lang.String name)
- Create a new MapProperty with the specified category and property name.
Assumes the property's default value is null.
- Parameters:
category
- Name of the category.name
- Name of the property within the category.
MapProperty
public MapProperty(java.lang.String category,
java.lang.String name,
java.lang.String defaultValue)
- Create a new MapProperty with the specified category, property name and
default value.
- Parameters:
category
- Name of the category.name
- Name of the property within the category.defaultValue
- Default value for this property if does not exist or null.
setValue
public boolean setValue(java.util.Map map,
java.lang.String value)
- Set value for this property.
- Parameters:
map
- The java.util.Map implementation used to store the value.value
- The desired parameter value, or null if the value should be
reset to its default.- Returns:
- True if the property value was changed as a result, false if the
property was already set to this value.
getValue
public java.lang.String getValue(java.util.Map map)
- Fetches current value for this property.
- Parameters:
map
- The java.util.Map implementation used to store the value.- Returns:
- The stored parameter value, or the MapProperty's default value
if no value has been stored.
addPropertyListener
public void addPropertyListener(MapPropertyListener listener)
- Adds a MapPropertyListener to the list of listeners that receive events.
- Parameters:
listener
- The listener to be added.
removePropertyListener
public void removePropertyListener(MapPropertyListener listener)
- Removes a MapPropertyListener from the list of listeners that receive
events.
- Parameters:
listener
- The listener to be removed.
firePropertyChange
public void firePropertyChange(java.util.Map map,
java.lang.String oldValue,
java.lang.String newValue)
- Notifies all registered MapPropertyListeners that the value of the
property has been changed.
- Parameters:
map
- The java.util.Map implementation used to hold the value.oldValue
- Prior value.newValue
- New value.