com.borland.primetime.properties
Class MapArrayProperty
java.lang.Object
|
+--com.borland.primetime.properties.Property
|
+--com.borland.primetime.properties.MapArrayProperty
- public class MapArrayProperty
- extends Property
Instances of MapArrayProperty are used to represent settings in a temporary
storage structure with a related set of zero or more values. Property
values may be copied to some more permanent structure by external
mechanisms.
Constructor Summary |
MapArrayProperty(java.lang.String category,
java.lang.String name)
Creates a property whose values will be stored as a sequence of individual
properties with the names 'name.0', 'name.1', etc. |
Method Summary |
void |
addPropertyListener(MapArrayPropertyListener listener)
Adds a MapArrayPropertyListener to the list of listeners that receive
events. |
void |
firePropertyChange(java.util.Map map,
java.lang.String[] newValue)
Notifies all registered MapArrayPropertyListeners that the value of the
property has been changed. |
java.lang.String[] |
getValues(java.util.Map map)
Fetches the current setting of this property. |
void |
removePropertyListener(MapArrayPropertyListener listener)
Removes a MapArrayPropertyListener from the list of listeners that
receive events. |
boolean |
setValues(java.util.Map map,
java.lang.String[] values)
Changes the current setting of the property to the array of strings
provided. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
MapArrayProperty
public MapArrayProperty(java.lang.String category,
java.lang.String name)
- Creates a property whose values will be stored as a sequence of individual
properties with the names 'name.0', 'name.1', etc.
- Parameters:
category
- The category this property will be stored under.name
- The root name used to generate each of the individual property
names for entries in the array.
setValues
public boolean setValues(java.util.Map map,
java.lang.String[] values)
- Changes the current setting of the property to the array of strings
provided.
- Parameters:
map
- The java.util.Map implementation used to store the value.values
- The desired array of parameter values. Null is treated the
same as an empty array.- Returns:
- True if the property value was changed as a result, false if the
property was already set to this value.
getValues
public java.lang.String[] getValues(java.util.Map map)
- Fetches the current setting of this property.
- Parameters:
map
- The java.util.Map implementation used to store the value.- Returns:
- The stored array of parameter values, or an empty array if no
values have been stored.
addPropertyListener
public void addPropertyListener(MapArrayPropertyListener listener)
- Adds a MapArrayPropertyListener to the list of listeners that receive
events.
- Parameters:
listener
- The listener.
removePropertyListener
public void removePropertyListener(MapArrayPropertyListener listener)
- Removes a MapArrayPropertyListener from the list of listeners that
receive events.
- Parameters:
listener
- The listener.
firePropertyChange
public void firePropertyChange(java.util.Map map,
java.lang.String[] newValue)
- Notifies all registered MapArrayPropertyListeners that the value of the
property has been changed.