⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taskthread.html

📁 这个是java的quicktime for java 的详细使用文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<PRE>public <B>TaskThread</B>(java.lang.String&nbsp;tName,                  int&nbsp;sleepTime)</PRE><DL><DD>Creates a TaskThread object. When the object's start method is called  the supplied name will be the name of the thread that is created by the task thread object.<DD><DL><DT><B>Parameters:</B><DD><CODE>sleepTime</CODE> - sets the sleep time that will be used when the thread starts</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="killAllThreads()"><!-- --></A><H3>killAllThreads</H3><PRE>public static final void <B>killAllThreads</B>()</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="getSleepTime()"><!-- --></A><H3>getSleepTime</H3><PRE>public int <B>getSleepTime</B>()</PRE><DL><DD>The time that the thread will sleep.<DD><DL></DL></DD></DL><HR><A NAME="setSleepTime(int)"><!-- --></A><H3>setSleepTime</H3><PRE>public void <B>setSleepTime</B>(int&nbsp;newTime)</PRE><DL><DD>The sleepTime for the thread. If the sleepTime is set to zero, the thread will only yield (but not sleep), otherwise it sleeps for the given time.<DD><DL></DL></DD></DL><HR><A NAME="addMember(java.lang.Object)"><!-- --></A><H3>addMember</H3><PRE>public boolean <B>addMember</B>(java.lang.Object&nbsp;member)</PRE><DL><DD>This method will add a taskable client to the list. It will not alter the state of the thread.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#addMember(java.lang.Object)">addMember</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - a taskable client that wants to be called periodically</DL></DD></DL><HR><A NAME="isAppropriate(java.lang.Object)"><!-- --></A><H3>isAppropriate</H3><PRE>public boolean <B>isAppropriate</B>(java.lang.Object&nbsp;object)</PRE><DL><DD>Returns true if the object is an instance of the Taskable interface.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#isAppropriate(java.lang.Object)">isAppropriate</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a boolean</DL></DD></DL><HR><A NAME="members()"><!-- --></A><H3>members</H3><PRE>public java.util.Enumeration <B>members</B>()</PRE><DL><DD>Returns an Enumeration for the current Taskable members of the collection.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#members()">members</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an Enumeration</DL></DD></DL><HR><A NAME="addAndStart(quicktime.app.time.Taskable)"><!-- --></A><H3>addAndStart</H3><PRE>public void <B>addAndStart</B>(<A HREF="../../../quicktime/app/time/Taskable.html">Taskable</A>&nbsp;t)</PRE><DL><DD>This method will add a taskable client to the list. If the thread was stopped (because there were no objects to task) this will start the thread up.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - the Taskable object to add to the collection.</DL></DD></DL><HR><A NAME="removeMember(java.lang.Object)"><!-- --></A><H3>removeMember</H3><PRE>public void <B>removeMember</B>(java.lang.Object&nbsp;member)</PRE><DL><DD>Removes the Taskable object from the collection. If this would leave the collection empty then the internal thread is stopped.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#removeMember(java.lang.Object)">removeMember</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - a task client that wants to be called periodically</DL></DD></DL><HR><A NAME="removeAll()"><!-- --></A><H3>removeAll</H3><PRE>public void <B>removeAll</B>()</PRE><DL><DD>Remove all task objects from the task list and stops the task thread.<DD><DL></DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Return the number of task current objects.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#size()">size</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an int</DL></DD></DL><HR><A NAME="hasMember(java.lang.Object)"><!-- --></A><H3>hasMember</H3><PRE>public boolean <B>hasMember</B>(java.lang.Object&nbsp;object)</PRE><DL><DD>Return true if the Taskable object is currently a member of the task list.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#hasMember(java.lang.Object)">hasMember</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>object</CODE> - the object to test if a member<DT><B>Returns:</B><DD>true if the object is a member</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Returns true if there are no Taskable objects in the collection<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/spaces/Collection.html#isEmpty()">isEmpty</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a boolean</DL></DD></DL><HR><A NAME="start()"><!-- --></A><H3>start</H3><PRE>public void <B>start</B>()</PRE><DL><DD>This will create a thread and start it running, calling task on each of the items you have added to the TaskThread object. If a thread is already active this call has no effect<DD><DL></DL></DD></DL><HR><A NAME="stop()"><!-- --></A><H3>stop</H3><PRE>public void <B>stop</B>()</PRE><DL><DD>This will destroy the thread and end the periodic calling of task objects.  You can restart this object later by calling start.  The priority and sleepTime will be persistent across start and stop calls, as will the task objects themselves.<DD><DL></DL></DD></DL><HR><A NAME="suspend()"><!-- --></A><H3>suspend</H3><PRE>public void <B>suspend</B>()</PRE><DL><DD>Suspends the execution of the task thread.<DD><DL></DL></DD></DL><HR><A NAME="resume()"><!-- --></A><H3>resume</H3><PRE>public void <B>resume</B>()</PRE><DL><DD>Resumes the execution of the task thread.<DD><DL></DL></DD></DL><HR><A NAME="isAlive()"><!-- --></A><H3>isAlive</H3><PRE>public boolean <B>isAlive</B>()</PRE><DL><DD>Returns the alive state of the thread.<DD><DL></DL></DD></DL><HR><A NAME="getPriority()"><!-- --></A><H3>getPriority</H3><PRE>public int <B>getPriority</B>()</PRE><DL><DD>Returns the current priority of the task thread.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the task thread priority or PRIORITY_NOT_SET if the TaskThread object has not had a priority explicitly set.</DL></DD></DL><HR><A NAME="setPriority(int)"><!-- --></A><H3>setPriority</H3><PRE>public void <B>setPriority</B>(int&nbsp;newPriority)</PRE><DL><DD>Sets the priority of the thread.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newPriority</CODE> - the new priority of the thread or any consequent threads created.</DL></DD></DL><HR><A NAME="run()"><!-- --></A><H3>run</H3><PRE>public void <B>run</B>()</PRE><DL><DD>Calls task on each of the task object in the internal task list. If an object's task call fails it is removed from the collection.<DD><DL><DT><B>Specified by: </B><DD><CODE>run</CODE> in interface <CODE>java.lang.Runnable</CODE></DL></DD></DL><HR><A NAME="finalize()"><!-- --></A><H3>finalize</H3><PRE>protected void <B>finalize</B>()                 throws java.lang.Throwable</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>String representation of the class.<DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/TaskThread.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../quicktime/app/time/Tasking.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../quicktime/app/time/Timer.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="TaskThread.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -