com.virtuosotechnologies.lib.container
Interface PropertySet

All Known Subinterfaces:
CommandNode, DatabaseController, ModifiablePropertySet, PaneController, RequestablePropertySet
All Known Implementing Classes:
AbstractCommandNode, BasicModifiablePropertySet, PseudoModifiablePropertySet, WrappingPropertySet

public interface PropertySet

A set of constrained properties. This is basically a hash table with several additional features: constraints on property values, default values, and listeners on state changes. Many applications will use the ModifiablePropertySet subinterface, which adds mutation methods.

This interface itself does not specify thread-safety semantics. The particular implementation or use in a larger interface should specify this. For example, standalone PropertySets may be fully synchronized and thread-safe. PropertySets related to AWT or Swing objects may require that all interaction be done on the AWT event thread.


Method Summary
 void addPropertySetListener(PropertySetListener listener)
          Add a PropertySetListener.
 Object getDefaultValue(ConstrainedKey key)
          Get the default value for a property.
 Object getValue(ConstrainedKey key)
          Get a property.
 void removePropertySetListener(PropertySetListener listener)
          Remove a PropertySetListener.
 

Method Detail

getValue

public Object getValue(ConstrainedKey key)
Get a property.

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. Returns null if there is no default.

Parameters:
key - key object for the property
Returns:
default value for the property

addPropertySetListener

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

Parameters:
listener - new listener

removePropertySetListener

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

Parameters:
listener - listener to remove