001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/
004    package graphlab.platform.attribute;
005    
006    import java.util.Collection;
007    
008    /**
009     * An Interface which is an AttributeSet and also it
010     * is notifiable<br>
011     * as an example see NotifiableAttributeSetImpl
012     * <br/>
013     * The difference between a NotifiableAttributeSet and a BlackBoard is that, NotifiableAttributeSet is designed
014     * for a small set of attributes, so for example getAttributeListeners() will return all listeners of all attributes,
015     * but BlackBoard is for a bigger set of attributes, and there you can give listeners for just one key at a time.
016     *
017     * @see NotifiableAttributeSetImpl
018     *
019     * @author Azin Azadi
020     */
021    public interface NotifiableAttributeSet extends AttributeSet {
022    
023        /**
024         * Add a listener to changes of an AttributeSet. <br>
025         * It's better to use a <code>List</code> because of
026         * <code>getAttributeListeners()</code> method.
027         *
028         * @param attributeListener the listener!
029         * @param attrNames         the name of attributes to addListener for change
030         */
031        public void addAttributeListener(AttributeListener attributeListener);
032    
033        /**
034         * @param attrNames
035         * @return List of listeners
036         */
037        public Collection<AttributeListener> getAttributeListeners();
038    
039        /**
040         * Remove a listener from list of listeners.
041         *
042         * @param attributeListener
043         */
044        public void removeAttributeListener(AttributeListener attributeListener);
045    }