All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.dip.PropertyChangeSupport
java.lang.Object
|
+----com.ibm.beans.dip.PropertyChangeSupport
- public class PropertyChangeSupport
- extends Object
- implements Serializable
This utility class is based on java.beans.PropertyChangeSupport
.
The main difference between java.beans.PropertyChangeSupport
and
this class is that this class supports using
com.ibm.beans.util.Collections
to hold the listeners instead
of being hardcoded to use only a Vector class. Also, the isEmpty()
and elements() methods were
added to this class to allow the user to see when listeners were
added.
- See Also:
- PropertyChangeSupport
-
PropertyChangeSupport(Object)
- Constructs a PropertyChangeSupport instance using the default Vector
implementation.
-
PropertyChangeSupport(Object, Collection)
- Constructs a PropertyChangeSupport instance using the input Collection.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a PropertyChangeListener instance to the listener list.
-
elements()
- Gets an enumeration of PropertyChangeListener instances.
-
firePropertyChange(String, Object, Object)
- Reports a bound property update to any registered listeners.
-
isEmpty()
- Checks to see if the collection of listeners is empty.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a PropertyChangeListener instance from the listener list.
PropertyChangeSupport
public PropertyChangeSupport(Object sourceBean)
- Constructs a PropertyChangeSupport instance using the default Vector
implementation.
- Parameters:
- sourceBean - The bean given as the source for any event.
PropertyChangeSupport
public PropertyChangeSupport(Object sourceBean,
Collection collection)
- Constructs a PropertyChangeSupport instance using the input Collection.
- Parameters:
- sourceBean - The bean given as the source for any event.
- collection - The Collection used to store the listeners.
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a PropertyChangeListener instance to the listener list.
- Parameters:
- listener - The listener to add.
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a PropertyChangeListener instance from the listener list.
- Parameters:
- listener - The listener to remove.
firePropertyChange
public void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
- Reports a bound property update to any registered listeners.
No event is fired if the old and new values are equal and non-null.
- Parameters:
- propertyName - The programmatic name of the changed property.
- oldValue - The old value of the property.
- newValue - The new value of the property.
elements
public final synchronized Enumeration elements()
- Gets an enumeration of PropertyChangeListener instances.
Use the Enumeration methods on
the returned object to fetch the elements sequentially.
- Returns:
- An enumeration of the listeners that will be fired in
the firePropertyChange() method.
isEmpty
public final boolean isEmpty()
- Checks to see if the collection of listeners is empty.
- Returns:
-
true
if empty; false
otherwise.
All Packages Class Hierarchy This Package Previous Next Index