public class TLcyStringProperties extends ALcyProperties
ALcyProperties
that can only store String
values. If an
attempt is made to store other values, an IllegalArgumentException
is thrown. Only accepting
String
s allows to easily load and store all key-value pairs, compare differences, etc. One can
think of this class as a java.util.Properties
object with built-in support for several simple data
types (e.g. int, int[], double, double[], boolean, ...) and events about changes.Constructor and Description |
---|
TLcyStringProperties()
Default Constructor
|
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.
|
Iterator<String> |
keys()
Returns the keys of this
TLcyProperties . |
protected void |
putImpl(String aKey,
Object aNewValue)
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, putAll, putBoolean, putBooleanArray, putColor, putColorArray, putDouble, putDoubleArray, putFloat, putFloatArray, putInt, putIntArray, putLong, putLongArray, putString, putStringArray, removePropertyChangeListener, removePropertyChangeListener, subset, synchronizeSFCT, unmodifiable
protected Object getImpl(String aKey)
ALcyProperties
getImpl
in class ALcyProperties
aKey
- The key, guaranteed to be not null
.null
if no value is associated.public void remove(String aKey)
ALcyProperties
remove
in class ALcyProperties
aKey
- the key to be removedpublic 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
protected void putImpl(String aKey, Object aNewValue)
ALcyProperties
putImpl
in class ALcyProperties
aKey
- The key, guaranteed to be not null
.aNewValue
- The value to associate to the key, guaranteed to be not null
.