com.virtuosotechnologies.lib.container
Class WrappingPropertySet

java.lang.Object
  extended bycom.virtuosotechnologies.lib.container.WrappingPropertySet
All Implemented Interfaces:
PropertySet

public class WrappingPropertySet
extends Object
implements PropertySet

A PropertySet that wraps another PropertySet. This PropertySet is not modifiable, but its value may change if the wrapped PropertySet changes. This implementation is fully synchronized and thread-safe.


Constructor Summary
WrappingPropertySet(PropertySet parent)
          Constructor
 
Method Summary
 void addPropertySetListener(PropertySetListener listener)
          Add a PropertySetListener.
 Object getDefaultValue(ConstrainedKey key)
          Get the default value for a property, or null if there is no default.
 Object getValue(ConstrainedKey key)
          Get a property.
 void removePropertySetListener(PropertySetListener listener)
          Remove a PropertySetListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappingPropertySet

public WrappingPropertySet(PropertySet parent)
Constructor

Parameters:
parent - PropertySet to wrap
Method Detail

getValue

public Object getValue(ConstrainedKey key)
Get a property.

Specified by:
getValue in interface PropertySet
Parameters:
key - key object for the property
Returns:
value for the property

getDefaultValue

public Object getDefaultValue(ConstrainedKey key)
Get the default value for a property, or null if there is no default.

Specified by:
getDefaultValue in interface PropertySet
Parameters:
key - key object for the property
Returns:
default value for the property

addPropertySetListener

public final void addPropertySetListener(PropertySetListener listener)
Add a PropertySetListener. Listeners should be added via weak references.

Specified by:
addPropertySetListener in interface PropertySet
Parameters:
listener - new listener

removePropertySetListener

public final void removePropertySetListener(PropertySetListener listener)
Remove a PropertySetListener. Does nothing if the listener is not already present.

Specified by:
removePropertySetListener in interface PropertySet
Parameters:
listener - listener to remove