|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
public interface PropertyBagInterface
A PropertyBagInterface defines a set of properties, much like a Dictionary but simpler: keys must be Strings. Abstractly, a PropertyBag is like a Java Bean with a set of dynamic as opposed to fixed properties. The set of properties on an instance can change over time.
A property bag is an implementation of the Variable State pattern from Kent Beck's book, Smalltalk Best Practices Patterns. The property bag is intended to be used as part of the internal implementation of a higher level object that has variable state, i.e. one whose set of properties changes over time. The property bag manages that set of variable properties in a consistent way.
Abstractly, a property bag
is like a Java Bean with a set of dynamic as opposed to
fixed properties. The set of properties on an instance can change
over time. The property bag sends PropertyBagChangedEvents
when a property is added, removed, replaced, or when that property
value changes its state, provided that object also sends PropertyChangeEvents
or PropertyBagChangedEvents (for example, the property may be
another PropertyBag).
This interface extends the com.sas.collection.StaticPropertyBagInterface, which provides the read-only methods for accessing a property bag. This interface adds the update methods.
StaticPropertyBagInterface,
PropertyBag,
DictionaryInterface| Method Summary | |
|---|---|
abstract void |
merge(StaticPropertyBagInterface other)
Merge into this bag any property from the source property bag which does not exist in this bag. |
abstract void |
remove(java.lang.String key)
Remove a property from this property bag. |
abstract void |
removeAll()
Remove all items from this property bag. |
abstract void |
set(StaticPropertyBagInterface other)
Add the contents of another property bag to this property bag. |
abstract void |
set(java.lang.String key,
java.lang.Object property)
Put a property in this property bag. |
| Methods inherited from interface com.sas.collection.StaticPropertyBagInterface |
|---|
clone, containsKey, count, get, get, listKeys, toDictionary |
| Methods inherited from interface com.sas.collection.PropertyBagChangedSource |
|---|
addPropertyBagChangedListener, removePropertyBagChangedListener |
| Method Detail |
|---|
void set(java.lang.String key,
java.lang.Object property)
key - the name of the property.
This string must be
an interned string and may not be null.
(Use key.intern() to create an interned string.
Note that Java String literals are automatically interned, so you need not do
"constant".intern())property - the value to associate with the property name.
Property values may be null.void remove(java.lang.String key)
key - the name of the property.
This string must be
an interned string and may not be null.
(Use key.intern() to create an interned string.
Note that Java String literals are automatically interned, so you need not do
"constant".intern())
- Throws:
java.util.NoSuchElementException - if the
bag does not contains the named element.void removeAll()
void set(StaticPropertyBagInterface other)
set(key, property) on this property bag
for each the key/property pair from the source.
other - another property bagmerge(com.sas.collection.StaticPropertyBagInterface)void merge(StaticPropertyBagInterface other)
other - another property bagset(com.sas.collection.StaticPropertyBagInterface)
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||