1. /*
  2. * @(#)Observer.java 1.19 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.util;
  8. /**
  9. * A class can implement the <code>Observer</code> interface when it
  10. * wants to be informed of changes in observable objects.
  11. *
  12. * @author Chris Warth
  13. * @version 1.19, 12/19/03
  14. * @see java.util.Observable
  15. * @since JDK1.0
  16. */
  17. public interface Observer {
  18. /**
  19. * This method is called whenever the observed object is changed. An
  20. * application calls an <tt>Observable</tt> object's
  21. * <code>notifyObservers</code> method to have all the object's
  22. * observers notified of the change.
  23. *
  24. * @param o the observable object.
  25. * @param arg an argument passed to the <code>notifyObservers</code>
  26. * method.
  27. */
  28. void update(Observable o, Object arg);
  29. }