Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.virtuosotechnologies.lib.propertyset
Class BasicPropertySet  view BasicPropertySet download BasicPropertySet.java

java.lang.Object
  extended bycom.virtuosotechnologies.lib.propertyset.BasicPropertySet
All Implemented Interfaces:
PropertySet

public class BasicPropertySet
extends java.lang.Object
implements PropertySet

A basic set of typed properties. Allows parenting of sets, so that sets can have other set define their default values.


Field Summary
private  PropertySetListener listener_
           
private  PropertySet parent_
           
private  java.util.Map properties_
           
private  com.virtuosotechnologies.lib.util.EventBroadcastHelper propertyBroadcaster_
           
 
Constructor Summary
BasicPropertySet()
          Constructor
BasicPropertySet(PropertySet parent)
          Constructor
 
Method Summary
 void addPropertySetListener(PropertySetListener listener)
          Add a PropertySetListener.
protected  void firePropertySetEvent(com.virtuosotechnologies.lib.base.ConstrainedKey key, java.lang.Object oldValue, java.lang.Object newValue, boolean isSourceOriginal)
          Fires a property set event
 java.lang.Object getDefaultValue(com.virtuosotechnologies.lib.base.ConstrainedKey key)
          Get the default value for a property, or null if there is no default.
 java.lang.Object getValue(com.virtuosotechnologies.lib.base.ConstrainedKey key)
          Get a property.
 void putValue(com.virtuosotechnologies.lib.base.ConstrainedKey key, java.lang.Object value)
          Set a property.
 void removePropertySetListener(PropertySetListener listener)
          Remove a PropertySetListener.
 void resetValue(com.virtuosotechnologies.lib.base.ConstrainedKey key)
          Reset a property to the default.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyBroadcaster_

private com.virtuosotechnologies.lib.util.EventBroadcastHelper propertyBroadcaster_

properties_

private java.util.Map properties_

parent_

private PropertySet parent_

listener_

private PropertySetListener listener_
Constructor Detail

BasicPropertySet

public BasicPropertySet()
Constructor


BasicPropertySet

public BasicPropertySet(PropertySet parent)
Constructor

Method Detail

getValue

public java.lang.Object getValue(com.virtuosotechnologies.lib.base.ConstrainedKey key)
Get a property.

Specified by:
getValue in interface PropertySet

getDefaultValue

public java.lang.Object getDefaultValue(com.virtuosotechnologies.lib.base.ConstrainedKey key)
Get the default value for a property, or null if there is no default.

Specified by:
getDefaultValue in interface PropertySet

putValue

public void putValue(com.virtuosotechnologies.lib.base.ConstrainedKey key,
                     java.lang.Object value)
Set a property.

Specified by:
putValue in interface PropertySet

resetValue

public void resetValue(com.virtuosotechnologies.lib.base.ConstrainedKey key)
Reset a property to the default. Sets it to null if there is no default.

Specified by:
resetValue in interface PropertySet

addPropertySetListener

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

Specified by:
addPropertySetListener in interface PropertySet

removePropertySetListener

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

Specified by:
removePropertySetListener in interface PropertySet

firePropertySetEvent

protected void firePropertySetEvent(com.virtuosotechnologies.lib.base.ConstrainedKey key,
                                    java.lang.Object oldValue,
                                    java.lang.Object newValue,
                                    boolean isSourceOriginal)
Fires a property set event