public abstract class ALcyPropertiesWrapper extends ALcyProperties
Convenience class to wrap an ALcyProperties
in that one only has to overwrite
those methods that are required. This is also known as the decorator design pattern.
Note that, generally speaking, an abstract class can't be wrapped because methods might be
added to the abstract class in a newer version of the API. The advantage of extending from this
ALcyPropertiesWrapper
is that if methods are ever added to
ALcyProperties
, they will also be added here.
Modifier | Constructor and Description |
---|---|
protected |
ALcyPropertiesWrapper(ALcyProperties aProperties)
Constructs a new
ALcyPropertiesWrapper that decorates the specified
ALcyProperties . |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this key-value pair list so that it contains no keys.
|
boolean |
containsKey(String aKey)
Returns true if the key-value pair with the specified key exists.
|
protected Object |
getImpl(String aKey)
Implementation version of the get method, which retrieves the value from the underlying store.
|
ALcyProperties |
getProperties()
Returns the original
ALcyProperties that is wrapped by this wrapper. |
Iterator<String> |
keys()
Returns the keys of this
TLcyProperties . |
void |
putAll(ALcyProperties aFromNode)
Copies all key value pairs from the given properties into this one.
|
protected void |
putImpl(String aKey,
Object aValue)
Implementation version of the put method, which puts the value in the underlying store.
|
void |
remove(String aKey)
Removes the key (and its corresponding value) from this key-value pair list.
|
int |
size()
Returns the number of key-value pairs.
|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, get, get, getBoolean, getBooleanArray, getColor, getColorArray, getDouble, getDoubleArray, getFloat, getFloatArray, getInt, getIntArray, getLong, getLongArray, getPropertyChangeListeners, getPropertyChangeListeners, getString, getStringArray, isEmpty, put, put, putAll, putBoolean, putBooleanArray, putColor, putColorArray, putDouble, putDoubleArray, putFloat, putFloatArray, putInt, putIntArray, putLong, putLongArray, putString, putStringArray, removePropertyChangeListener, removePropertyChangeListener, subset, synchronizeSFCT, unmodifiable
protected ALcyPropertiesWrapper(ALcyProperties aProperties)
Constructs a new ALcyPropertiesWrapper
that decorates the specified
ALcyProperties
.
Note that this wrapper does not propagate property change events. It is up to the
subclasses, who know how the keys and/or values are modified, to make sure that the correct
property change events are fired when the wrapped ALcyProperties
instance
changes.
aProperties
- The ALcyProperties
to decorate. Must not be null
.public ALcyProperties getProperties()
Returns the original ALcyProperties
that is wrapped by this wrapper.
ALcyProperties
. Never null
.protected Object getImpl(String aKey)
ALcyProperties
getImpl
in class ALcyProperties
aKey
- The key, guaranteed to be not null
.null
if no value is associated.protected void putImpl(String aKey, Object aValue)
ALcyProperties
putImpl
in class ALcyProperties
aKey
- The key, guaranteed to be not null
.aValue
- The value to associate to the key, guaranteed to be not null
.public void remove(String aKey)
ALcyProperties
remove
in class ALcyProperties
aKey
- the key to be removedpublic void putAll(ALcyProperties aFromNode)
ALcyProperties
putAll
in class ALcyProperties
aFromNode
- The properties to copy from.public int size()
ALcyProperties
size
in class ALcyProperties
public boolean containsKey(String aKey)
ALcyProperties
containsKey
in class ALcyProperties
aKey
- key to look forpublic Iterator<String> keys()
ALcyProperties
TLcyProperties
.keys
in class ALcyProperties
TLcyProperties
.public void clear()
ALcyProperties
null-null-null
property change event indicating all properties have changed,
or in a separate event for all removed properties (implementation specific).clear
in class ALcyProperties