Java Future 线程接口
时间:2021-09-07
本文章向大家介绍Java Future 线程接口,主要包括Java Future 线程接口使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
源码展示
package java.util.concurrent;
/**
* A Future represents the result of an asynchronous computation.
*/
public interface Future<V> {
/**
* Attempts to cancel execution of this task.
*/
boolean cancel(boolean mayInterruptIfRunning);
/**
* Returns true if this task was cancelled before it completed normally.
*/
boolean isCancelled();
/**
* Returns true if this task completed.
*/
boolean isDone();
/**
* Waits if necessary for the computation to complete, and then
* retrieves its result.
*/
V get() throws InterruptedException, ExecutionException;
/**
* Waits if necessary for at most the given time for the computation
* to complete, and then retrieves its result, if available.
*
* @param timeout the maximum time to wait
* @param unit the time unit of the timeout argument
*/
V get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException;
}
原文地址:https://www.cnblogs.com/feiqiangsheng/p/15237458.html
- java教程
- Java快速入门
- Java 开发环境配置
- Java基本语法
- Java 对象和类
- Java 基本数据类型
- Java 变量类型
- Java 修饰符
- Java 运算符
- Java 循环结构
- Java 分支结构
- Java Number类
- Java Character类
- Java String类
- Java StringBuffer和StringBuilder类
- Java 数组
- Java 日期时间
- Java 正则表达式
- Java 方法
- Java 流(Stream)、文件(File)和IO
- Java 异常处理
- Java 继承
- Java 重写(Override)与重载(Overload)
- Java 多态
- Java 抽象类
- Java 封装
- Java 接口
- Java 包(package)
- Java 数据结构
- Java 集合框架
- Java 泛型
- Java 序列化
- Java 网络编程
- Java 发送邮件
- Java 多线程编程
- Java Applet基础
- Java 文档注释
- Linux进程间通信方式之socket使用实例
- python实现图片识别汽车功能
- Mac下Anaconda的安装和使用教程
- linux ubuntu中安装、卸载和删除python-igraph的方法教程
- python实现汽车管理系统
- tp5框架基于ajax实现异步删除图片的方法示例
- Python3 jupyter notebook 服务器搭建过程
- PHP图像处理 imagestring添加图片水印与文字水印操作示例
- CentOS6.9下NFS服务安装配置教程
- Python 中 function(#) (X)格式 和 (#)在Python3.*中的注意事项
- PHP 枚举类型的管理与设计知识点总结
- Linux静态链接库使用类模板的快速排序算法
- TP5(thinkPHP5)框架使用ajax实现与后台数据交互的方法小结
- php post换行的方法
- apache实现部署多个网站(一个ip部署多域名)的方法详解