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