<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.util.Observable
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.util.html">This Package</a>  <a href="java.util.Locale.html#_top_">Previous</a>  <a href="java.util.Properties.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.util.Observable
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.util.Observable
</pre>
<hr>
<dl>
  <dt> public class <b>Observable</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
This class represents an observable object, or "data"
 in the model-view paradigm. It can be subclassed to represent an
 object that the application wants to have observed.
 <p>
 An observable object can have one or more observers. After an
 observable instance changes, an application calling the
 <code>Observable</code>'s <code>notifyObservers</code> method
 causes all of its observers to be notified of the change by a call
 to their <code>update</code> method.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#notifyObservers()">notifyObservers</a>, <a href="#notifyObservers(java.lang.Object)">notifyObservers</a>, <a href="java.util.Observer.html#_top_">Observer</a>, <a href="java.util.Observer.html#update(java.util.Observable, java.lang.Object)">update</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Observable()"><b>Observable</b></a>()
  <dd> Construct an Observable with zero Observers
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addObserver(java.util.Observer)"><b>addObserver</b></a>(Observer)
  <dd>  Adds an observer to the set of observers for this object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#clearChanged()"><b>clearChanged</b></a>()
  <dd>  Indicates that this object has no longer changed, or that it has
 already notified all of its observers of its most recent change.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#countObservers()"><b>countObservers</b></a>()
  <dd>  Returns the number of observers of this object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#deleteObserver(java.util.Observer)"><b>deleteObserver</b></a>(Observer)
  <dd>  Deletes an observer from the set of observers of this object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#deleteObservers()"><b>deleteObservers</b></a>()
  <dd>  Clears the observer list so that this object no longer has any observers.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#hasChanged()"><b>hasChanged</b></a>()
  <dd>  Tests if this object has changed.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#notifyObservers()"><b>notifyObservers</b></a>()
  <dd>  If this object has changed, as indicated by the
 <code>hasChanged</code> method, then notify all of its observers
 and then call the <code>clearChanged</code> method to
 indicate that this object has no longer changed.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#notifyObservers(java.lang.Object)"><b>notifyObservers</b></a>(Object)
  <dd>  If this object has changed, as indicated by the
 <code>hasChanged</code> method, then notify all of its observers
 and then call the <code>clearChanged</code> method to indicate
 that this object has no longer changed.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setChanged()"><b>setChanged</b></a>()
  <dd>  Indicates that this object has changed.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Observable"></a>
<a name="Observable()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Observable</b>
<pre>
 public Observable()
</pre>
<dl>
  <dd> Construct an Observable with zero Observers
<p>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="addObserver(java.util.Observer)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addObserver"><b>addObserver</b></a>
<pre>
 public synchronized void addObserver(<a href="java.util.Observer.html#_top_">Observer</a> o)
</pre>
<dl>
  <dd> Adds an observer to the set of observers for this object.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> o - an observer to be added.
  </dl></dd>
</dl>
<a name="deleteObserver(java.util.Observer)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="deleteObserver"><b>deleteObserver</b></a>
<pre>
 public synchronized void deleteObserver(<a href="java.util.Observer.html#_top_">Observer</a> o)
</pre>
<dl>
  <dd> Deletes an observer from the set of observers of this object.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> o - the observer to be deleted.
  </dl></dd>
</dl>
<a name="notifyObservers()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="notifyObservers"><b>notifyObservers</b></a>
<pre>
 public void notifyObservers()
</pre>
<dl>
  <dd> If this object has changed, as indicated by the
 <code>hasChanged</code> method, then notify all of its observers
 and then call the <code>clearChanged</code> method to
 indicate that this object has no longer changed.
 <p>
 Each observer has its <code>update</code> method called with two
 arguments: this observable object and <code>null</code>.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#clearChanged()">clearChanged</a>, <a href="#hasChanged()">hasChanged</a>, <a href="java.util.Observer.html#update(java.util.Observable, java.lang.Object)">update</a>
  </dl></dd>
</dl>
<a name="notifyObservers(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="notifyObservers"><b>notifyObservers</b></a>
<pre>
 public void notifyObservers(<a href="java.lang.Object.html#_top_">Object</a> arg)
</pre>
<dl>
  <dd> If this object has changed, as indicated by the
 <code>hasChanged</code> method, then notify all of its observers
 and then call the <code>clearChanged</code> method to indicate
 that this object has no longer changed.
 <p>
 Each observer has its <code>update</code> method called with two
 arguments: this observable object and the <code>arg</code> argument.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> arg - any object.
    <dt> <b>See Also:</b>
    <dd> <a href="#clearChanged()">clearChanged</a>, <a href="#hasChanged()">hasChanged</a>, <a href="java.util.Observer.html#update(java.util.Observable, java.lang.Object)">update</a>
  </dl></dd>
</dl>
<a name="deleteObservers()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="deleteObservers"><b>deleteObservers</b></a>
<pre>
 public synchronized void deleteObservers()
</pre>
<dl>
  <dd> Clears the observer list so that this object no longer has any observers.
<p>
</dl>
<a name="setChanged()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setChanged"><b>setChanged</b></a>
<pre>
 protected synchronized void setChanged()
</pre>
<dl>
  <dd> Indicates that this object has changed.
<p>
</dl>
<a name="clearChanged()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="clearChanged"><b>clearChanged</b></a>
<pre>
 protected synchronized void clearChanged()
</pre>
<dl>
  <dd> Indicates that this object has no longer changed, or that it has
 already notified all of its observers of its most recent change.
 This method is called automatically by the
 <code>notifyObservers</code> methods.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#notifyObservers()">notifyObservers</a>, <a href="#notifyObservers(java.lang.Object)">notifyObservers</a>
  </dl></dd>
</dl>
<a name="hasChanged()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="hasChanged"><b>hasChanged</b></a>
<pre>
 public synchronized boolean hasChanged()
</pre>
<dl>
  <dd> Tests if this object has changed.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> <code>true</code> if the <code>setChanged</code> method
          has been called more recently than the <code>clearChanged</code>
          method on this object; <code>false</code> otherwise.
    <dt> <b>See Also:</b>
    <dd> <a href="#clearChanged()">clearChanged</a>, <a href="#setChanged()">setChanged</a>
  </dl></dd>
</dl>
<a name="countObservers()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="countObservers"><b>countObservers</b></a>
<pre>
 public synchronized int countObservers()
</pre>
<dl>
  <dd> Returns the number of observers of this object.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of observers of this object.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.util.html">This Package</a>  <a href="java.util.Locale.html#_top_">Previous</a>  <a href="java.util.Properties.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
