软件包 | 描述 |
---|---|
java.lang |
提供对java编程语言的设计基础课。
|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
java.nio.file |
定义的接口和类的java虚拟机访问文件,文件属性,文件系统。
|
java.nio.file.attribute |
提供对文件和文件系统属性的访问的接口和类。
|
java.util.concurrent |
在并发编程中常用的实用类。
|
java.util.concurrent.locks |
接口和类提供了一个锁定和等待条件的框架,这种情况与内置的同步和监视器不同。
|
javax.swing |
提供了一套“轻量级”(所有的java语言)组件,以最大可能的程度,在所有平台上工作。
|
Modifier and Type | Method and Description |
---|---|
boolean |
Process.waitFor(long timeout, TimeUnit unit)
使当前线程等待,如果有必要,直到这
Process 对象表示的子进程终止,或指定的等待时间的流逝。
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
AsynchronousChannelGroup.awaitTermination(long timeout, TimeUnit unit)
等待本集团终止。
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)
读这信入子序列给定的缓冲区字节序列。
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)
从这个通道读取一个字节序列到给定的缓冲区中。
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)
写一个字节序列的子序列对该通道从给定的缓冲区。
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)
从给定的缓冲区中写入该通道的一个字节序列。
|
Modifier and Type | Method and Description |
---|---|
WatchKey |
WatchService.poll(long timeout, TimeUnit unit)
检索和删除下一个表键,如果需要的话,等待指定的等待时间,如果没有仍然存在。
|
Modifier and Type | Method and Description |
---|---|
static FileTime |
FileTime.from(long value, TimeUnit unit)
返回一个
FileTime 代表一个值在给定的粒度单位。
|
long |
FileTime.to(TimeUnit unit)
返回给定粒度单位的值。
|
Modifier and Type | Method and Description |
---|---|
static TimeUnit |
TimeUnit.valueOf(String name)
返回此类型具有指定名称的枚举常量。
|
static TimeUnit[] |
TimeUnit.values()
返回一个数组包含该枚举类型的常量,它们的顺序声明。
|
Modifier and Type | Method and Description |
---|---|
int |
CyclicBarrier.await(long timeout, TimeUnit unit)
等到所有的
parties援引
await 这个障碍,或指定的等待时间的流逝。
|
boolean |
CountDownLatch.await(long timeout, TimeUnit unit)
使当前线程等待直到锁向下计数为零,除非线程
interrupted,或指定的等待时间的流逝。
|
int |
Phaser.awaitAdvanceInterruptibly(int phase, long timeout, TimeUnit unit)
等待着这个相位的相位提前从给定的相位值或给定的超时时间,扔
InterruptedException 如果中断等待,或立即返回如果相电流不等于给定值或终止这种移相器的相。
|
boolean |
ForkJoinPool.awaitQuiescence(long timeout, TimeUnit unit)
如果被forkjointask池中运行,相当的效果
ForkJoinTask.helpQuiesce() 。
|
boolean |
ThreadPoolExecutor.awaitTermination(long timeout, TimeUnit unit) |
boolean |
ExecutorService.awaitTermination(long timeout, TimeUnit unit)
直到所有的任务都完成后,关闭请求,或超时发生,或当前线程被中断,以先发生的情况。
|
boolean |
ForkJoinPool.awaitTermination(long timeout, TimeUnit unit)
直到所有的任务都完成后,关闭请求,或超时发生,或当前线程被中断,以先发生的情况。
|
long |
TimeUnit.convert(long sourceDuration, TimeUnit sourceUnit)
将给定单位中的给定时间持续时间转换为该单元。
|
V |
Exchanger.exchange(V x, long timeout, TimeUnit unit)
等待另一个线程到达这个交换点(除非当前线程
interrupted或指定的等待时间的流逝),然后将给定对象,回报的对象。
|
V |
ForkJoinTask.get(long timeout, TimeUnit unit)
如果需要的话,在大多数给定的计算时间完成,然后检索其结果,如果可用。
|
V |
Future.get(long timeout, TimeUnit unit)
如果需要的话,在大多数给定的计算时间完成,然后检索其结果,如果可用。
|
T |
CompletableFuture.get(long timeout, TimeUnit unit)
如果需要的话,在大多数给定的时间为这个未来完成,然后返回其结果,如果可用。
|
V |
FutureTask.get(long timeout, TimeUnit unit) |
long |
Delayed.getDelay(TimeUnit unit)
返回与此对象关联的剩余延迟,在给定的时间单元中。
|
long |
ThreadPoolExecutor.getKeepAliveTime(TimeUnit unit)
返回线程保持活着的时间,这是在超过核心池大小的线程可能会在被终止之前闲置的时间量。
|
<T> List<Future<T>> |
AbstractExecutorService.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) |
<T> List<Future<T>> |
ExecutorService.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
执行给定的任务,返回一个未来持有他们的状态和结果的列表时,所有的完成或超时到期,以先发生的。
|
<T> T |
AbstractExecutorService.invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) |
<T> T |
ExecutorService.invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
执行给定的任务,返回一个成功完成的结果(即,不抛出异常),如果做了超时之前经过。
|
boolean |
LinkedTransferQueue.offer(E e, long timeout, TimeUnit unit)
在这个队列的尾部插入指定的元素。
|
boolean |
LinkedBlockingDeque.offer(E e, long timeout, TimeUnit unit) |
boolean |
ArrayBlockingQueue.offer(E e, long timeout, TimeUnit unit)
在这个队列的尾部插入指定的元素,等待到指定的等待时间,如果队列已满,则等待可用空间可用的等待时间。
|
boolean |
BlockingQueue.offer(E e, long timeout, TimeUnit unit)
将指定的元素插入到队列中,等待到指定的等待时间,如果需要的空间将成为可用的。
|
boolean |
DelayQueue.offer(E e, long timeout, TimeUnit unit)
将指定的元素插入到这个延迟队列中。
|
boolean |
LinkedBlockingQueue.offer(E e, long timeout, TimeUnit unit)
在这个队列的尾部插入指定的元素,在必要时等待空间到指定的等待时间,以获得可用的空间。
|
boolean |
PriorityBlockingQueue.offer(E e, long timeout, TimeUnit unit)
将指定的元素插入到该优先级队列中。
|
boolean |
BlockingDeque.offer(E e, long timeout, TimeUnit unit)
插入指定元素为代表的deque队列(换句话说,在这个队列的尾部),等待到指定的等待时间,如果空间成为必要。
|
boolean |
SynchronousQueue.offer(E e, long timeout, TimeUnit unit)
将指定的元素插入到队列中,等待必要的时间到指定的等待另一个线程接收到的等待时间。
|
boolean |
LinkedBlockingDeque.offerFirst(E e, long timeout, TimeUnit unit) |
boolean |
BlockingDeque.offerFirst(E e, long timeout, TimeUnit unit)
在这个队列的前面插入指定元素,等待到指定的等待时间,如果空间成为必要。
|
boolean |
LinkedBlockingDeque.offerLast(E e, long timeout, TimeUnit unit) |
boolean |
BlockingDeque.offerLast(E e, long timeout, TimeUnit unit)
在这个队列的末尾插入指定元素,等待到指定的等待时间,如果空间成为必要。
|
E |
LinkedTransferQueue.poll(long timeout, TimeUnit unit) |
E |
LinkedBlockingDeque.poll(long timeout, TimeUnit unit) |
E |
ArrayBlockingQueue.poll(long timeout, TimeUnit unit) |
E |
BlockingQueue.poll(long timeout, TimeUnit unit)
检索和删除此队列的头,等待指定的等待时间,如果需要的元素成为可用。
|
E |
DelayQueue.poll(long timeout, TimeUnit unit)
检索并删除此队列的头,在必要时等待,直到该队列上有一个过期的延迟的元素,或指定的等待时间过期。
|
E |
LinkedBlockingQueue.poll(long timeout, TimeUnit unit) |
Future<V> |
CompletionService.poll(long timeout, TimeUnit unit)
检索和删除表示下一个已完成的任务的未来,如果需要的话,在指定的等待时间,如果没有的话,等待。
|
Future<V> |
ExecutorCompletionService.poll(long timeout, TimeUnit unit) |
E |
PriorityBlockingQueue.poll(long timeout, TimeUnit unit) |
E |
BlockingDeque.poll(long timeout, TimeUnit unit)
检索并移除该deque表示队列的头部(换句话说,这个容器的第一个元素),等待到指定的等待时间,如果一个元素成为必要。
|
E |
SynchronousQueue.poll(long timeout, TimeUnit unit)
检索并删除此队列的头,等待必要时到指定的等待时间,另一个线程插入它。
|
E |
LinkedBlockingDeque.pollFirst(long timeout, TimeUnit unit) |
E |
BlockingDeque.pollFirst(long timeout, TimeUnit unit)
检索并移除此队列的第一个元素,等待到指定的等待时间,如果一个元素成为必要。
|
E |
LinkedBlockingDeque.pollLast(long timeout, TimeUnit unit) |
E |
BlockingDeque.pollLast(long timeout, TimeUnit unit)
检索并移除此队列的最后一个元素,等待到指定的等待时间,如果一个元素成为必要。
|
<V> ScheduledFuture<V> |
ScheduledThreadPoolExecutor.schedule(Callable<V> callable, long delay, TimeUnit unit) |
<V> ScheduledFuture<V> |
ScheduledExecutorService.schedule(Callable<V> callable, long delay, TimeUnit unit)
创建和执行一个scheduledfuture成为给定的延迟后启用。
|
ScheduledFuture<?> |
ScheduledThreadPoolExecutor.schedule(Runnable command, long delay, TimeUnit unit) |
ScheduledFuture<?> |
ScheduledExecutorService.schedule(Runnable command, long delay, TimeUnit unit)
创建并执行在给定的延迟后启用的一一个射击动作。
|
ScheduledFuture<?> |
ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) |
ScheduledFuture<?> |
ScheduledExecutorService.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
创建和执行一个周期的动作变成了使后先给定的初始延迟,随后与给定的时期;这是执行将开始
initialDelay 然后
initialDelay+period ,然后
initialDelay + 2 * period ,等等。
|
ScheduledFuture<?> |
ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) |
ScheduledFuture<?> |
ScheduledExecutorService.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
创建和执行一个周期性的行动,使第一次后,给定的初始延迟,并随后与给定的一个执行之间的终止和下一个开始的开始。
|
void |
ThreadPoolExecutor.setKeepAliveTime(long time, TimeUnit unit)
设置线程可能在被终止之前保持空闲的时间限制。
|
boolean |
Semaphore.tryAcquire(int permits, long timeout, TimeUnit unit)
获得了从这个信号量许可证号码,如果所有可用在给定的等待时间和当前线程没有被
interrupted。
|
boolean |
Semaphore.tryAcquire(long timeout, TimeUnit unit)
从这个信号获取许可证,如果有一个可用在给定的等待时间和当前线程没有被
interrupted。
|
boolean |
LinkedTransferQueue.tryTransfer(E e, long timeout, TimeUnit unit)
将元素对消费者是否可以这样做,在超时之前逝去。
|
boolean |
TransferQueue.tryTransfer(E e, long timeout, TimeUnit unit)
将元素对消费者是否可以这样做,在超时之前逝去。
|
Constructor and Description |
---|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)
创建具有给定的初始参数和默认线厂和拒绝执行处理程序的一个新的
ThreadPoolExecutor 。
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
创建具有给定的初始参数和默认线厂一个新的
ThreadPoolExecutor 。
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
创建一个新的
ThreadPoolExecutor 与给定的初始参数和默认拒绝执行处理程序。
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)
创建具有给定的初始参数的一种新
ThreadPoolExecutor 。
|
Modifier and Type | Method and Description |
---|---|
boolean |
AbstractQueuedSynchronizer.ConditionObject.await(long time, TimeUnit unit)
实现定时等待状态。
|
boolean |
AbstractQueuedLongSynchronizer.ConditionObject.await(long time, TimeUnit unit)
实现定时等待状态。
|
boolean |
Condition.await(long time, TimeUnit unit)
使当前线程等待信号或中断,或指定的等待时间的流逝。
|
boolean |
ReentrantLock.tryLock(long timeout, TimeUnit unit)
获取该锁如果不是由另一个线程在等待时间和当前线程没有被
interrupted。
|
boolean |
ReentrantReadWriteLock.ReadLock.tryLock(long timeout, TimeUnit unit)
获取读锁,如果写入锁是不是被另一个线程在等待时间和当前线程没有被
interrupted。
|
boolean |
ReentrantReadWriteLock.WriteLock.tryLock(long timeout, TimeUnit unit)
获得写锁如果不是由另一个线程在等待时间和当前线程没有被
interrupted。
|
boolean |
Lock.tryLock(long time, TimeUnit unit)
获取锁,如果它是免费的在给定的等待时间和当前线程没有被
interrupted。
|
long |
StampedLock.tryReadLock(long time, TimeUnit unit)
非独占获取锁,如果它是在给定的时间内可用,当前线程没有被中断。
|
long |
StampedLock.tryWriteLock(long time, TimeUnit unit)
只获取锁,如果它是在给定的时间内可用,当前线程没有被中断。
|
Modifier and Type | Method and Description |
---|---|
T |
SwingWorker.get(long timeout, TimeUnit unit)
如果需要的话,在大多数给定的计算时间完成,然后检索其结果,如果可用。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.