001    package data.events;
002    
003    /**
004     * An <i>abstract</i> adapter class for receiving data basket change events. The methods in this class are
005     * empty. This class exists as convenience for creating listener objects.
006     *
007     * <p>Extend this class to create a DataBasketEvent listener and override the methods for the events of
008     * interest. (If you implement the DataBasketListener interface, you have to define all of the methods in
009     * it. This abstract class defines empty method bodies for them all, so you can concentrate on defining
010     * methods only for events you care about.)</p>
011     *
012     * <p>Create a listener object using the extended class and then register it with a ListenableDataBasket using
013     * the DataBasket's {@link data.ListenableDataBasket#addDataBasketListener} method. When the DataBasket's
014     * contents change, the relevant method in the listener object is invoked, and a {@link DataBasketEvent} is
015     * passed to it.</p>
016     *
017     * @author Steffen Zschaler
018     * @version 2.0 19/08/1999
019     * @since v2.0
020     */
021    public abstract class DataBasketAdapter extends Object implements DataBasketListener {
022    
023        /**
024         * Called when a DataBasketEntry was added to the DataBasket.
025         *
026         * @param e an event object that describes the event.
027         *
028         * @override Sometimes
029         */
030        public void addedDBE(DataBasketEvent e) {}
031    
032        /**
033         * Called when a DataBasketEntry was removed from the DataBasket.
034         *
035         * @param e an event object that describes the event.
036         *
037         * @override Sometimes
038         */
039        public void removedDBE(DataBasketEvent e) {}
040    
041        /**
042         * Called when the DataBasket changed in a manner too complex for the two other types of events.
043         *
044         * @param e an event object that describes the event. (<code>e.getAffectedEntry() == null</code>!)
045         *
046         * @override Sometimes
047         */
048        public void dataBasketChanged(DataBasketEvent e) {}
049    }