001package stdlib;
002/**
003 * A generic subscriber which a class can implement when it wants to be informed
004 * of changes in published objects.
005 *
006 * @param <T> the type of the publisher object
007 * @param <U> the type of the optional data argument
008 * @see Subscriptions
009 */
010public interface Subscriber<T, U> {
011        /**
012         * This method is called whenever the published object is changed.
013         *
014         * @param publisher the object which was the source of the notification.
015         * @param data an optional data parameter which encapsulates any
016         *   additional data about the event
017         */
018        void update(T publisher, U data);
019}