📄 18.doc.html
字号:
<a name="45328"></a>
<p>
<pre><a name="44399"></a>
/**
<a name="44400"></a> * Returns a String that represents this Object.
<a name="44401"></a> * It is recommended that all subclasses override
<a name="44402"></a> * this method.
<a name="44403"></a> */
<a name="44404"></a> public String toString() {
<a name="44405"></a> return getClass().getName() + "@" +
<a name="44406"></a> Integer.toHexString(hashCode());
<a name="44407"></a> }
<br><a name="44409"></a>
/**
<a name="44410"></a> * Notifies a single waiting thread on a change in
<a name="44411"></a> * condition of another thread. The thread effecting
<a name="44412"></a> * the change notifies the waiting thread using notify().
<a name="44413"></a> * Threads that want to wait for a condition to change
<a name="44414"></a> * before proceeding can call wait(). <p>
<a name="44415"></a> * <em>The method notify() can be called only by the
<a name="44416"></a> * thread that is the owner of the current object's
<a name="44417"></a> * monitor lock.</em>
<a name="44418"></a> *
<a name="44419"></a> * @exception IllegalMonitorStateException If the
<a name="44420"></a> * current thread is not the owner
<a name="44421"></a> * of the Object's monitor lock.
<a name="44422"></a> * @see Object#wait
<a name="44423"></a> * @see Object#notifyAll
<a name="44424"></a> */
<a name="44425"></a> public final native void notify();
<br><a name="44427"></a>
/**
<a name="44428"></a> * Notifies all the threads waiting for a condition to
<a name="44429"></a> * change. Threads that are waiting are generally waiting
<a name="44430"></a> * for another thread to change some condition. Thus, the
<a name="44431"></a> * thread effecting a change that more than one thread is
<a name="44432"></a> * waiting for notifies all the waiting threads using
<a name="44433"></a> * the method notifyAll(). Threads that want to wait for
<a name="44434"></a> * a condition to change before proceeding can call
<a name="44435"></a> * wait(). <p>
<a name="44436"></a> * <em>The method notifyAll() can be called only by the
<a name="44437"></a> * thread that is the owner of the current object's
<a name="44438"></a> * monitor lock.</em>
<a name="44439"></a> *
<a name="44555"></a> * @exception IllegalMonitorStateException If the
<a name="44556"></a> * current thread is not the owner
<a name="44557"></a> * of the Object's monitor lock.
<a name="44443"></a> * @see Object#wait
<a name="44444"></a> * @see Object#notify
<a name="44445"></a> */
<a name="44446"></a> public final native void notifyAll();
<br></pre><pre><a name="44448"></a>
/**
<a name="44449"></a> * Causes a thread to wait until it is notified or the
<a name="44450"></a> * specified timeout expires. <p>
<a name="44451"></a> * <em>The method wait(millis) can be called only by
<a name="44452"></a> * the thread that is the owner of the current object's
<a name="44453"></a> * monitor lock.</em>
<a name="44454"></a> *
<a name="44455"></a> * @param millis the maximum time to wait,
<a name="44456"></a> * in milliseconds
<a name="44559"></a> * @exception IllegalMonitorStateException If the
<a name="44560"></a> * current thread is not the owner
<a name="44561"></a> * of the Object's monitor lock.
<a name="44460"></a> * @exception InterruptedException Another thread has
<a name="44461"></a> * interrupted this thread.
<a name="44462"></a> */
<a name="44463"></a> public final native void wait(long millis)
<a name="44464"></a> throws InterruptedException;
<br><a name="44466"></a>
/**
<a name="44467"></a> * More accurate wait.
<a name="44468"></a> * <em>The method wait(millis, nanos) can be called only
<a name="44469"></a> * by the thread that is the owner of the current
<a name="44470"></a> * object's monitor lock.</em>
<a name="44471"></a> *
<a name="44472"></a> * @param millis the maximum time to wait,
<a name="44473"></a> * in milliseconds
<a name="44474"></a> * @param nano additional time to wait,
<a name="44475"></a> * in nanoseconds
<a name="44476"></a> * (range 0-999999)
<a name="44563"></a> * @exception IllegalMonitorStateException If the
<a name="44564"></a> * current thread is not the owner
<a name="44565"></a> * of the Object's monitor lock.
<a name="44566"></a> * @exception InterruptedException Another thread has
<a name="44567"></a> * interrupted this thread.
<a name="44543"></a> */
<a name="44483"></a> public final void wait(long millis, int nanos)
<a name="44484"></a> throws InterruptedException
<a name="44485"></a> {
<a name="44486"></a> if (nanos >= 500000 || (nanos != 0 && millis==0))
<a name="44487"></a> timeout++;
<a name="44488"></a> wait(timeout);
<a name="44489"></a> }
<br><a name="44491"></a>
/**
<a name="44492"></a> * Causes a thread to wait forever until it is notified.
<a name="44493"></a> * <p>
<a name="44494"></a> * <em>The method wait() can be called only by the
<a name="44495"></a> * thread that is the owner of the current object's
<a name="44496"></a> * monitor lock.</em>
<a name="44497"></a> *
</pre><pre><a name="44569"></a> * @exception IllegalMonitorStateException If the
<a name="44570"></a> * current thread is not the owner
<a name="44571"></a> * of the Object's monitor lock.
<a name="44572"></a> * @exception InterruptedException Another thread has
<a name="44573"></a> * interrupted this thread.
<a name="44503"></a> */
<a name="44504"></a> public final void wait() throws InterruptedException {
<a name="44505"></a> wait(0);
<a name="44506"></a> }
<br></pre><pre><a name="44508"></a>
/**
<a name="44509"></a> * Code to perform when this object is garbage collected.
<a name="44510"></a> * The default is that nothing needs to be performed.
<a name="44511"></a> *
<a name="44512"></a> * Any exception thrown by a finalize method causes the
<a name="44513"></a> * finalization to halt. But otherwise, it is ignored.
<a name="44514"></a> */
<a name="44515"></a> protected void finalize() throws Throwable { }
<br><a name="44516"></a>}
</pre><a name="44904"></a>
From this source code, the <code>javadoc</code> tool produced the following HTML file,
which is available for browsing at <code>http://java.sun.com/Series</code>, our Java
Series web site:
<p><a name="44575"></a>
<p><font size=-1><!--NewPage--></font><p>
<a name="44576"></a>
<p><font size=-1><html></font><p>
<a name="44577"></a>
<p><font size=-1><head></font><p>
<a name="44578"></a>
<p><font size=-1><!-- Generated by javadoc on Wed Jun 26 11:40:38 EDT 1996 --></font><p>
<a name="44579"></a>
<p><font size=-1><a name="_top_"></a></font><p>
<a name="44580"></a>
<p><font size=-1><title></font><p>
<a name="44581"></a>
<p><font size=-1> Class java.lang.Object</font><p>
<a name="44582"></a>
<p><font size=-1></title></font><p>
<a name="44583"></a>
<p><font size=-1></head></font><p>
<a name="44584"></a>
<p><font size=-1><body></font><p>
<a name="44585"></a>
<p><font size=-1><pre></font><p>
<a name="44919"></a>
<p><font size=-1><a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy¬<br></a> <a href="Package-java.lang.html">This Package</a> <a href="java.lang.N¬<br>umber.html#_top_">Previous</a> <a href="java.lang.OutOfMemoryError.html#_top¬<br>_">Next</a> <a href="AllNames.html">Index</a></pre></font><p>
<a name="44920"></a>
<p><font size=-1><hr></font><p>
<a name="44588"></a>
<p><font size=-1><h1></font><p>
<a name="44589"></a>
<p><font size=-1> Class java.lang.Object</font><p>
<a name="44590"></a>
<p><font size=-1></h1></font><p>
<a name="44591"></a>
<p><font size=-1><pre></font><p>
<a name="44592"></a>
<p><font size=-1>java.lang.Object</font><p>
<a name="44593"></a>
<p><font size=-1></pre></font><p>
<a name="44594"></a>
<p><font size=-1><hr></font><p>
<a name="44595"></a>
<p><font size=-1><dl></font><p>
<a name="44596"></a>
<p><font size=-1> <dt> public class <b>Object</b></font><p>
<a name="44597"></a>
<p><font size=-1></dl></font><p>
<a name="44598"></a>
<p><font size=-1>The root of the Class hierarchy. Every Class in the</font><p>
<a name="44599"></a>
<p><font size=-1>system has Object as its ultimate parent. Every variable</font><p>
<a name="44600"></a>
<p><font size=-1>and method defined here is available in every Object.</font><p>
<a name="44601"></a>
<p><font size=-1><dl></font><p>
<a name="44602"></a>
<p><font size=-1> <dt> <b>Version:</b></font><p>
<a name="44603"></a>
<p><font size=-1> <dd> 1.37, 26 Jun 1996</font><p>
<a name="44604"></a>
<p><font size=-1> <dt> <b>See Also:</b></font><p>
<a name="44605"></a>
<p><font size=-1> <dd> <a href="java.lang.Class.html#_top_">Class</a></font><p>
<a name="44606"></a>
<p><font size=-1></dl></font><p>
<a name="44607"></a>
<p><font size=-1><hr></font><p>
<a name="44608"></a>
<p><font size=-1><a name="index"></a></font><p>
<a name="44938"></a>
<p><font size=-1><h2></font><p>
<a name="44939"></a>
<p><font size=-1> <img src="images/constructor-index.gif" width=275 height=38 alt="Constructo¬<br>r Index"></font><p>
<a name="44926"></a>
<p><font size=-1></h2></font><p>
<a name="44612"></a>
<p><font size=-1><dl></font><p>
<a name="44613"></a>
<p><font size=-1> <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44614"></a>
<p><font size=-1> <a href="#Object()"><b>Object</b></a>()</font><p>
<a name="44615"></a>
<p><font size=-1> <dd> </font><p>
<a name="44616"></a>
<p><font size=-1></dl></font><p>
<a name="44617"></a>
<p><font size=-1><h2></font><p>
<a name="44618"></a>
<p><font size=-1> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></font><p>
<a name="44619"></a>
<p><font size=-1></h2></font><p>
<a name="44620"></a>
<p><font size=-1><dl></font><p>
<a name="44621"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44622"></a>
<p><font size=-1> <a href="#clone()"><b>clone</b></a>()</font><p>
<a name="44623"></a>
<p><font size=-1> <dd> Creates a clone of the object.</font><p>
<a name="44624"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44625"></a>
<p><font size=-1> <a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)</font><p>
<a name="44626"></a>
<p><font size=-1> <dd> Compares two Objects for equality.</font><p>
<a name="44627"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44628"></a>
<p><font size=-1> <a href="#finalize()"><b>finalize</b></a>()</font><p>
<a name="44629"></a>
<p><font size=-1> <dd> Code to perform when this object is garbage collected.</font><p>
<a name="44630"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44631"></a>
<p><font size=-1> <a href="#getClass()"><b>getClass</b></a>()</font><p>
<a name="44632"></a>
<p><font size=-1> <dd> Returns the Class of this Object.</font><p>
<a name="44633"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44634"></a>
<p><font size=-1> <a href="#hashCode()"><b>hashCode</b></a>()</font><p>
<a name="44635"></a>
<p><font size=-1> <dd> Returns a hashcode for this Object.</font><p>
<a name="44636"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
<a name="44637"></a>
<p><font size=-1> <a href="#notify()"><b>notify</b></a>()</font><p>
<a name="44638"></a>
<p><font size=-1> <dd> Notifies a single waiting thread on a change in</font><p>
<a name="44639"></a>
<p><font size=-1>condition of another thread.</font><p>
<a name="44640"></a>
<p><font size=-1> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "></font><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -