|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
public interface StaticPropertyBagInterface
A StaticPropertyBagInterface defines a read-only set
of properties, much like a Dictionary but
simpler: keys must be Strings. 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.
A property bag emits a PropertyBagChangedEvent events when the bag has changed (i.e. items added or removed from the bag). A property bag also fires change events when an item in the bag changes its state (provided that item is a com.sas.collection.PropertyChangedSource or com.sas.beans.PropertyChangeSource).
This interface defines the read-only methods to access the contents of a property bag, or to add a listener for change events. Use PropertybadInterface for the update methods.
PropertyBag,
PropertyBagInterface,
PropertyBagChangedSource,
PropertyChangeSource,
PropertyBagChangedEvent,
DictionaryInterface| Method Summary | |
|---|---|
abstract java.lang.Object |
clone()
Clone a property bag. |
abstract boolean |
containsKey(java.lang.String key)
Determine if this property bag contains a property with this name (key). |
abstract int |
count()
Return the number of properties in this property bag. |
abstract java.lang.Object |
get(java.lang.String key)
Get an item from a property bag. |
abstract java.lang.Object |
get(java.lang.String key,
java.lang.Object defaultValue)
Get an item from a property bag, or return a default if it does not exist. |
abstract java.lang.String[] |
listKeys()
Return a list of the keys for this property bag. |
abstract DictionaryInterface |
toDictionary(DictionaryInterface initialDictionary)
Place this property bag's items into a dictionary and return that dictionary. |
| Methods inherited from interface com.sas.collection.PropertyBagChangedSource |
|---|
addPropertyBagChangedListener, removePropertyBagChangedListener |
| Method Detail |
|---|
int count()
count in interface com.sas.util.Countableboolean containsKey(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.)
- Returns:
- true if this property bag contains the property.
java.lang.Object get(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.)
- Returns:
- the object associated with the key
- Throws:
java.util.NoSuchElementException - if there
is no such property in this property bag.
(this is necessary to distinguish between
no such key and a property value of null.)
java.lang.Object get(java.lang.String key,
java.lang.Object defaultValue)
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.)defaultValue - a default value to return if the named property does
not exist in this property bag. See also PropertyBag.NO_SUCH_ELEMENT for a value you can use if you want to combine a test
for existence with a get operation.
- Returns:
- the object associated with the key, or the defaultValue
if the bag does not contain an element for the specified key.
DictionaryInterface toDictionary(DictionaryInterface initialDictionary)
initialDictionary - a dictionary into which this property bag
places all of its values via set(key, value).
The dictionary may be null, in which case
a new Dictionary is created.
java.lang.String[] listKeys()
StringCollection
java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface com.sas.PublicClonablejava.lang.CloneNotSupportedException - if the object cannot be cloned.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||