Class ALcyPropertiesWrapper
- All Implemented Interfaces:
ILcdPropertyChangeSource
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.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedALcyPropertiesWrapper(ALcyProperties aProperties) Constructs a newALcyPropertiesWrapperthat decorates the specifiedALcyProperties. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears this key-value pair list so that it contains no keys.booleancontainsKey(String aKey) Returns true if the key-value pair with the specified key exists.protected ObjectImplementation version of the get method, which retrieves the value from the underlying store.Returns the originalALcyPropertiesthat is wrapped by this wrapper.keys()Returns the keys of thisTLcyProperties.voidputAll(ALcyProperties aFromNode) Copies all key value pairs from the given properties into this one.protected voidImplementation version of the put method, which puts the value in the underlying store.voidRemoves the key (and its corresponding value) from this key-value pair list.intsize()Returns the number of key-value pairs.Methods inherited from class com.luciad.lucy.util.properties.ALcyProperties
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
-
Constructor Details
-
ALcyPropertiesWrapper
Constructs a new
ALcyPropertiesWrapperthat decorates the specifiedALcyProperties.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
ALcyPropertiesinstance changes.- Parameters:
aProperties- TheALcyPropertiesto decorate. Must not benull.
-
-
Method Details
-
getProperties
Returns the original
ALcyPropertiesthat is wrapped by this wrapper.- Returns:
- The original
ALcyProperties. Nevernull.
-
getImpl
Description copied from class:ALcyPropertiesImplementation version of the get method, which retrieves the value from the underlying store.- Specified by:
getImplin classALcyProperties- Parameters:
aKey- The key, guaranteed to be notnull.- Returns:
- The value associated with the key, or
nullif no value is associated.
-
putImpl
Description copied from class:ALcyPropertiesImplementation version of the put method, which puts the value in the underlying store.- Specified by:
putImplin classALcyProperties- Parameters:
aKey- The key, guaranteed to be notnull.aValue- The value to associate to the key, guaranteed to be notnull.
-
remove
Description copied from class:ALcyPropertiesRemoves the key (and its corresponding value) from this key-value pair list. This method does nothing if the key is unknown.- Specified by:
removein classALcyProperties- Parameters:
aKey- the key to be removed
-
putAll
Description copied from class:ALcyPropertiesCopies all key value pairs from the given properties into this one.- Overrides:
putAllin classALcyProperties- Parameters:
aFromNode- The properties to copy from.
-
size
public int size()Description copied from class:ALcyPropertiesReturns the number of key-value pairs.- Specified by:
sizein classALcyProperties- Returns:
- the number of key-value pairs.
-
containsKey
Description copied from class:ALcyPropertiesReturns true if the key-value pair with the specified key exists.- Specified by:
containsKeyin classALcyProperties- Parameters:
aKey- key to look for- Returns:
- true if the key-value pair with the specified key exists.
-
keys
Description copied from class:ALcyPropertiesReturns the keys of thisTLcyProperties.- Specified by:
keysin classALcyProperties- Returns:
- the keys of this
TLcyProperties.
-
clear
public void clear()Description copied from class:ALcyPropertiesClears this key-value pair list so that it contains no keys. Calling this method could result in anull-null-nullproperty change event indicating all properties have changed, or in a separate event for all removed properties (implementation specific).- Specified by:
clearin classALcyProperties
-