runnable.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 700 行 · 第 1/3 页

HTML
700
字号
                       long&nbsp;initialDelay,                       long&nbsp;delay,                       <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;创建并执行一个在给定初始延迟后首次启用的定期操作,随后,在每一次执行终止和下一次执行开始之间都存在给定的延迟。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;?&gt;</CODE></FONT></TD><TD><CODE><B>ScheduledThreadPoolExecutor.</B><B><A HREF="../../util/concurrent/ScheduledThreadPoolExecutor.html#submit(java.lang.Runnable)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;?&gt;</CODE></FONT></TD><TD><CODE><B>ExecutorService.</B><B><A HREF="../../util/concurrent/ExecutorService.html#submit(java.lang.Runnable)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提交一个 Runnable 任务用于执行,并返回一个表示该任务的 Future。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;?&gt;</CODE></FONT></TD><TD><CODE><B>AbstractExecutorService.</B><B><A HREF="../../util/concurrent/AbstractExecutorService.html#submit(java.lang.Runnable)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>ScheduledThreadPoolExecutor.</B><B><A HREF="../../util/concurrent/ScheduledThreadPoolExecutor.html#submit(java.lang.Runnable, T)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task,       T&nbsp;result)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>ExecutorService.</B><B><A HREF="../../util/concurrent/ExecutorService.html#submit(java.lang.Runnable, T)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task,       T&nbsp;result)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提交一个 Runnable 任务用于执行,并返回一个 Future,该 Future 表示任务一旦完成后即返回给定的结果。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;T&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>AbstractExecutorService.</B><B><A HREF="../../util/concurrent/AbstractExecutorService.html#submit(java.lang.Runnable, T)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task,       T&nbsp;result)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;<A HREF="../../util/concurrent/ExecutorCompletionService.html" title="ExecutorCompletionService 中的类型参数">V</A>&gt;</CODE></FONT></TD><TD><CODE><B>ExecutorCompletionService.</B><B><A HREF="../../util/concurrent/ExecutorCompletionService.html#submit(java.lang.Runnable, V)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task,       <A HREF="../../util/concurrent/ExecutorCompletionService.html" title="ExecutorCompletionService 中的类型参数">V</A>&nbsp;result)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;<A HREF="../../util/concurrent/CompletionService.html" title="CompletionService 中的类型参数">V</A>&gt;</CODE></FONT></TD><TD><CODE><B>CompletionService.</B><B><A HREF="../../util/concurrent/CompletionService.html#submit(java.lang.Runnable, V)">submit</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;task,       <A HREF="../../util/concurrent/CompletionService.html" title="CompletionService 中的类型参数">V</A>&nbsp;result)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提交要执行的 Runnable 任务,并返回一个表示任务完成的 Future,可以提取或轮询此任务。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">参数类型为 <A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A> 的 <A HREF="../../util/concurrent/package-summary.html">java.util.concurrent</A> 中的构造方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../util/concurrent/CyclicBarrier.html#CyclicBarrier(int, java.lang.Runnable)">CyclicBarrier</A></B>(int&nbsp;parties,              <A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;barrierAction)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;创建一个新的 <tt>CyclicBarrier</tt>,它将在给定数量的参与者(线程)处于等待状态时启动,并在启动 barrier 时执行给定的屏障操作,该操作由最后一个进入 barrier 的线程执行。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../util/concurrent/FutureTask.html#FutureTask(java.lang.Runnable, V)">FutureTask</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;runnable,           <A HREF="../../util/concurrent/FutureTask.html" title="FutureTask 中的类型参数">V</A>&nbsp;result)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;创建一个 <tt>FutureTask</tt>,一旦运行就执行给定的 <tt>Runnable</tt>,并安排成功完成时 <tt>get</tt> 返回给定的结果 。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">类型变量类型为 <A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A> 的 <A HREF="../../util/concurrent/package-summary.html">java.util.concurrent</A> 中的构造方法参数</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../util/concurrent/ThreadPoolExecutor.html#ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue)">ThreadPoolExecutor</A></B>(int&nbsp;corePoolSize,                   int&nbsp;maximumPoolSize,                   long&nbsp;keepAliveTime,                   <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit,                   <A HREF="../../util/concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">BlockingQueue</A>&lt;<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&gt;&nbsp;workQueue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用给定的初始参数和默认的线程工厂及处理程序创建新的 <tt>ThreadPoolExecutor</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../util/concurrent/ThreadPoolExecutor.html#ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.0AC32E6979">ThreadPoolExecutor</A></B>(int&nbsp;corePoolSize,                   int&nbsp;maximumPoolSize,                   long&nbsp;keepAliveTime,                   <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit,                   <A HREF="../../util/concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">BlockingQueue</A>&lt;<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&gt;&nbsp;workQueue,                   <A HREF="../../util/concurrent/RejectedExecutionHandler.html" title="java.util.concurrent 中的接口">RejectedExecutionHandler</A>&nbsp;handler)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用给定的初始参数创建新的 <tt>ThreadPoolExecutor</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../util/concurrent/ThreadPoolExecutor.html#ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.047F6FC9F1">ThreadPoolExecutor</A></B>(int&nbsp;corePoolSize,                   int&nbsp;maximumPoolSize,                   long&nbsp;keepAliveTime,                   <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit,                   <A HREF="../../util/concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">BlockingQueue</A>&lt;<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&gt;&nbsp;workQueue,                   <A HREF="../../util/concurrent/ThreadFactory.html" title="java.util.concurrent 中的接口">ThreadFactory</A>&nbsp;threadFactory)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用给定的初始参数创建新的 <tt>ThreadPoolExecutor</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../util/concurrent/ThreadPoolExecutor.html#ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.0617778962">ThreadPoolExecutor</A></B>(int&nbsp;corePoolSize,                   int&nbsp;maximumPoolSize,                   long&nbsp;keepAliveTime,                   <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit,                   <A HREF="../../util/concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">BlockingQueue</A>&lt;<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&gt;&nbsp;workQueue,                   <A HREF="../../util/concurrent/ThreadFactory.html" title="java.util.concurrent 中的接口">ThreadFactory</A>&nbsp;threadFactory,                   <A HREF="../../util/concurrent/RejectedExecutionHandler.html" title="java.util.concurrent 中的接口">RejectedExecutionHandler</A>&nbsp;handler)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用给定的初始参数创建新的 <tt>ThreadPoolExecutor</tt>。</TD></TR></TABLE>&nbsp;<P><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="跳过导航链接"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../Runnable.html" title="java.lang 中的接口"><FONT CLASS="NavBarFont1"><B>类</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>使用</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Standard&nbsp;Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;上一个&nbsp;&nbsp;下一个</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html@java_2Flang_2F_2Fclass-useRunnable.html" target="_top"><B>框架</B></A>  &nbsp;&nbsp;<A HREF="Runnable.html" target="_top"><B>无框架</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="../../../../../../../../../java.sun.com/cgi-bin/bugreport.cgi">提交错误或意见</a><br>有关更多的 API 参考资料和开发人员文档,请参阅 <a href="../../../../../../../../../java.sun.com/j2se/1.5.0/docs/relnotes/devdocs-vs-specs.html">Java 2 SDK SE 开发人员文档</a>。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。 <p>版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守<a href="../../../../../../../../../java.sun.com/j2se/1.5.0/docs/relnotes/license.html">许可证条款</a>。另请参阅<a href="../../../../../../../../../java.sun.com/docs/redist.html">文档重新分发政策</a>。</font></BODY></HTML>

⌨️ 快捷键说明

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