IT. Expert System.

Android Reference

PropertyChangeSupport


java.beans

Class PropertyChangeSupport

  • All Implemented Interfaces:
    Serializable


    public class PropertyChangeSupport
    extends Object
    implements Serializable
    Manages a list of listeners to be notified when a property changes. Listeners subscribe to be notified of all property changes, or of changes to a single named property.

    This class is thread safe. No locking is necessary when subscribing or unsubscribing listeners, or when publishing events. Callers should be careful when publishing events because listeners may not be thread safe.

    See Also:
    Serialized Form
    • Constructor Detail

      • PropertyChangeSupport

        public PropertyChangeSupport(Object sourceBean)
        Creates a new instance that uses the source bean as source for any event.
        Parameters:
        sourceBean - the bean used as source for all events.
    • Method Detail

      • firePropertyChange

        public void firePropertyChange(String propertyName,
                              Object oldValue,
                              Object newValue)
        Fires a PropertyChangeEvent with the given name, old value and new value. As source the bean used to initialize this instance is used. If the old value and the new value are not null and equal the event will not be fired.
        Parameters:
        propertyName - the name of the property
        oldValue - the old value of the property
        newValue - the new value of the property
      • fireIndexedPropertyChange

        public void fireIndexedPropertyChange(String propertyName,
                                     int index,
                                     Object oldValue,
                                     Object newValue)
        Fires an IndexedPropertyChangeEvent with the given name, old value, new value and index. As source the bean used to initialize this instance is used. If the old value and the new value are not null and equal the event will not be fired.
        Parameters:
        propertyName - the name of the property
        index - the index
        oldValue - the old value of the property
        newValue - the new value of the property
      • removePropertyChangeListener

        public void removePropertyChangeListener(String propertyName,
                                        PropertyChangeListener listener)
        Unsubscribes listener from change notifications for the property named propertyName. If multiple subscriptions exist for listener, it will receive one fewer notifications when the property changes. If the property name or listener is null or not subscribed, this method silently does nothing.
      • addPropertyChangeListener

        public void addPropertyChangeListener(String propertyName,
                                     PropertyChangeListener listener)
        Subscribes listener to change notifications for the property named propertyName. If the listener is already subscribed, it will receive an additional notification when the property changes. If the property name or listener is null, this method silently does nothing.
      • getPropertyChangeListeners

        public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
        Returns the subscribers to be notified when propertyName changes. This includes both listeners subscribed to all property changes and listeners subscribed to the named property only.
      • firePropertyChange

        public void firePropertyChange(String propertyName,
                              boolean oldValue,
                              boolean newValue)
        Fires a property change of a boolean property with the given name. If the old value and the new value are not null and equal the event will not be fired.
        Parameters:
        propertyName - the property name
        oldValue - the old value
        newValue - the new value
      • fireIndexedPropertyChange

        public void fireIndexedPropertyChange(String propertyName,
                                     int index,
                                     boolean oldValue,
                                     boolean newValue)
        Fires a property change of a boolean property with the given name. If the old value and the new value are not null and equal the event will not be fired.
        Parameters:
        propertyName - the property name
        index - the index of the changed property
        oldValue - the old value
        newValue - the new value
      • firePropertyChange

        public void firePropertyChange(String propertyName,
                              int oldValue,
                              int newValue)
        Fires a property change of an integer property with the given name. If the old value and the new value are not null and equal the event will not be fired.
        Parameters:
        propertyName - the property name
        oldValue - the old value
        newValue - the new value
      • fireIndexedPropertyChange

        public void fireIndexedPropertyChange(String propertyName,
                                     int index,
                                     int oldValue,
                                     int newValue)
        Fires a property change of an integer property with the given name. If the old value and the new value are not null and equal the event will not be fired.
        Parameters:
        propertyName - the property name
        index - the index of the changed property
        oldValue - the old value
        newValue - the new value
      • hasListeners

        public boolean hasListeners(String propertyName)
        Returns true if there are listeners registered to the property with the given name.
        Parameters:
        propertyName - the name of the property
        Returns:
        true if there are listeners registered to that property, false otherwise.
      • removePropertyChangeListener

        public void removePropertyChangeListener(PropertyChangeListener listener)
        Unsubscribes listener from change notifications for all properties. If the listener has multiple subscriptions, it will receive one fewer notification when properties change. If the property name or listener is null or not subscribed, this method silently does nothing.
      • addPropertyChangeListener

        public void addPropertyChangeListener(PropertyChangeListener listener)
        Subscribes listener to change notifications for all properties. If the listener is already subscribed, it will receive an additional notification. If the listener is null, this method silently does nothing.
      • getPropertyChangeListeners

        public PropertyChangeListener[] getPropertyChangeListeners()
        Returns all subscribers. This includes both listeners subscribed to all property changes and listeners subscribed to a single property.
      • firePropertyChange

        public void firePropertyChange(PropertyChangeEvent event)
        Publishes a property change event to all listeners of that property. If the event's old and new values are equal (but non-null), no event will be published.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1084 / 159174898. Delta: 0.03513 с