| Package | Description |
|---|---|
| java.lang |
Provides classes that are fundamental to the design of the Java programming language.
|
| java.nio.channels |
Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.
|
| java.nio.file |
Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.
|
| java.nio.file.attribute |
Interfaces and classes providing access to file and file system attributes.
|
| java.util.concurrent |
Utility classes commonly useful in concurrent programming.
|
| java.util.concurrent.locks |
Interfaces and classes providing a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors.
|
| javax.swing |
Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
Process.waitFor(long timeout, TimeUnit
Causes the current thread to wait, if necessary, until the subprocess represented by this
Process object has terminated, or the specified waiting time elapses.
|
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
AsynchronousChannelGroup.awaitTermination(long timeout, TimeUnit
Awaits termination of the group.
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer
Reads a sequence of bytes from this channel into a subsequence of the given buffers.
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer
Reads a sequence of bytes from this channel into the given buffer.
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer
Writes a sequence of bytes to this channel from a subsequence of the given buffers.
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer
Writes a sequence of bytes to this channel from the given buffer.
|
| Modifier and Type | Method and Description |
|---|---|
WatchKey |
WatchService.poll(long timeout, TimeUnit
Retrieves and removes the next watch key, waiting if necessary up to the specified wait time if none are yet present.
|
| Modifier and Type | Method and Description |
|---|---|
static FileTime |
FileTime.from(long value, TimeUnit
Returns a
FileTime representing a value at the given unit of granularity.
|
long |
FileTime.to(TimeUnit
Returns the value at the given unit of granularity.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeUnit |
TimeUnit.valueOf(String
Returns the enum constant of this type with the specified name.
|
static TimeUnit |
TimeUnit.values()
Returns an array containing the constants of this enum type, in the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
CountDownLatch.await(long timeout, TimeUnit
Causes the current thread to wait until the latch has counted down to zero, unless the thread is
interrupted, or the specified waiting time elapses.
|
int |
CyclicBarrier.await(long timeout, TimeUnit
Waits until all
parties have invoked
await on this barrier, or the specified waiting time elapses.
|
int |
Phaser.awaitAdvanceInterruptibly(int phase, long timeout, TimeUnit
Awaits the phase of this phaser to advance from the given phase value or the given timeout to elapse, throwing
InterruptedException if interrupted while waiting, or returning immediately if the current phase is not equal to the given phase value or this phaser is terminated.
|
boolean |
ForkJoinPool.awaitQuiescence(long timeout, TimeUnit
If called by a ForkJoinTask operating in this pool, equivalent in effect to
ForkJoinTask.
|
boolean |
ExecutorService.awaitTermination(long timeout, TimeUnit
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
|
boolean |
ForkJoinPool.awaitTermination(long timeout, TimeUnit
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
|
boolean |
ThreadPoolExecutor.awaitTermination(long timeout, TimeUnit
|
long |
TimeUnit.convert(long sourceDuration, TimeUnit
Converts the given time duration in the given unit to this unit.
|
V |
Exchanger.exchange(V x, long timeout, TimeUnit
Waits for another thread to arrive at this exchange point (unless the current thread is
interrupted or the specified waiting time elapses), and then transfers the given object to it, receiving its object in return.
|
V |
ForkJoinTask.get(long timeout, TimeUnit
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
|
T |
CompletableFuture.get(long timeout, TimeUnit
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
|
V |
Future.get(long timeout, TimeUnit
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
|
V |
FutureTask.get(long timeout, TimeUnit
|
long |
Delayed.getDelay(TimeUnit
Returns the remaining delay associated with this object, in the given time unit.
|
long |
ThreadPoolExecutor.getKeepAliveTime(TimeUnit
Returns the thread keep-alive time, which is the amount of time that threads in excess of the core pool size may remain idle before being terminated.
|
<T> List |
ExecutorService.invokeAll(Collection
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first.
|
<T> List |
AbstractExecutorService.invokeAll(Collection
|
<T> T |
ExecutorService.invokeAny(Collection
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do before the given timeout elapses.
|
<T> T |
AbstractExecutorService.invokeAny(Collection
|
boolean |
SynchronousQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element into this queue, waiting if necessary up to the specified wait time for another thread to receive it.
|
boolean |
LinkedBlockingQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.
|
boolean |
BlockingQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.
|
boolean |
LinkedTransferQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element at the tail of this queue.
|
boolean |
ArrayBlockingQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full.
|
boolean |
LinkedBlockingDeque.offer(E e, long timeout, TimeUnit
|
boolean |
DelayQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element into this delay queue.
|
boolean |
BlockingDeque.offer(E e, long timeout, TimeUnit
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque), waiting up to the specified wait time if necessary for space to become available.
|
boolean |
PriorityBlockingQueue.offer(E e, long timeout, TimeUnit
Inserts the specified element into this priority queue.
|
boolean |
LinkedBlockingDeque.offerFirst(E e, long timeout, TimeUnit
|
boolean |
BlockingDeque.offerFirst(E e, long timeout, TimeUnit
Inserts the specified element at the front of this deque, waiting up to the specified wait time if necessary for space to become available.
|
boolean |
LinkedBlockingDeque.offerLast(E e, long timeout, TimeUnit
|
boolean |
BlockingDeque.offerLast(E e, long timeout, TimeUnit
Inserts the specified element at the end of this deque, waiting up to the specified wait time if necessary for space to become available.
|
E |
SynchronousQueue.poll(long timeout, TimeUnit
Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it.
|
E |
LinkedBlockingQueue.poll(long timeout, TimeUnit
|
Future |
ExecutorCompletionService.poll(long timeout, TimeUnit
|
E |
BlockingQueue.poll(long timeout, TimeUnit
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
|
E |
LinkedTransferQueue.poll(long timeout, TimeUnit
|
E |
ArrayBlockingQueue.poll(long timeout, TimeUnit
|
E |
LinkedBlockingDeque.poll(long timeout, TimeUnit
|
E |
DelayQueue.poll(long timeout, TimeUnit
Retrieves and removes the head of this queue, waiting if necessary until an element with an expired delay is available on this queue, or the specified wait time expires.
|
E |
BlockingDeque.poll(long timeout, TimeUnit
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), waiting up to the specified wait time if necessary for an element to become available.
|
E |
PriorityBlockingQueue.poll(long timeout, TimeUnit
|
Future |
CompletionService.poll(long timeout, TimeUnit
Retrieves and removes the Future representing the next completed task, waiting if necessary up to the specified wait time if none are yet present.
|
E |
LinkedBlockingDeque.pollFirst(long timeout, TimeUnit
|
E |
BlockingDeque.pollFirst(long timeout, TimeUnit
Retrieves and removes the first element of this deque, waiting up to the specified wait time if necessary for an element to become available.
|
E |
LinkedBlockingDeque.pollLast(long timeout, TimeUnit
|
E |
BlockingDeque.pollLast(long timeout, TimeUnit
Retrieves and removes the last element of this deque, waiting up to the specified wait time if necessary for an element to become available.
|
<V> ScheduledFuture |
ScheduledThreadPoolExecutor.schedule(Callable
|
<V> ScheduledFuture |
ScheduledExecutorService.schedule(Callable
Creates and executes a ScheduledFuture that becomes enabled after the given delay.
|
ScheduledFuture |
ScheduledThreadPoolExecutor.schedule(Runnable
|
ScheduledFuture |
ScheduledExecutorService.schedule(Runnable
Creates and executes a one-shot action that becomes enabled after the given delay.
|
ScheduledFuture |
ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable
|
ScheduledFuture |
ScheduledExecutorService.scheduleAtFixedRate(Runnable
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after
initialDelay then
initialDelay+period, then
initialDelay + 2 * period, and so on.
|
ScheduledFuture |
ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable
|
ScheduledFuture |
ScheduledExecutorService.scheduleWithFixedDelay(Runnable
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next.
|
void |
ThreadPoolExecutor.setKeepAliveTime(long time, TimeUnit
Sets the time limit for which threads may remain idle before being terminated.
|
boolean |
Semaphore.tryAcquire(int permits, long timeout, TimeUnit
Acquires the given number of permits from this semaphore, if all become available within the given waiting time and the current thread has not been
interrupted.
|
boolean |
Semaphore.tryAcquire(long timeout, TimeUnit
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been
interrupted.
|
boolean |
LinkedTransferQueue.tryTransfer(E e, long timeout, TimeUnit
Transfers the element to a consumer if it is possible to do so before the timeout elapses.
|
boolean |
TransferQueue.tryTransfer(E e, long timeout, TimeUnit
Transfers the element to a consumer if it is possible to do so before the timeout elapses.
|
| Constructor and Description | |
|---|---|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit
Creates a new
ThreadPoolExecutor with the given initial parameters and default thread factory and rejected execution handler.
|
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit
Creates a new
ThreadPoolExecutor with the given initial parameters and default thread factory.
|
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit
Creates a new
ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
|
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit
Creates a new
ThreadPoolExecutor with the given initial parameters.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
AbstractQueuedSynchronizer.ConditionObject.await(long time, TimeUnit
Implements timed condition wait.
|
boolean |
Condition.await(long time, TimeUnit
Causes the current thread to wait until it is signalled or interrupted, or the specified waiting time elapses.
|
boolean |
AbstractQueuedLongSynchronizer.ConditionObject.await(long time, TimeUnit
Implements timed condition wait.
|
boolean |
Lock.tryLock(long time, TimeUnit
Acquires the lock if it is free within the given waiting time and the current thread has not been
interrupted.
|
boolean |
ReentrantLock.tryLock(long timeout, TimeUnit
Acquires the lock if it is not held by another thread within the given waiting time and the current thread has not been
interrupted.
|
boolean |
ReentrantReadWriteLock.ReadLock.tryLock(long timeout, TimeUnit
Acquires the read lock if the write lock is not held by another thread within the given waiting time and the current thread has not been
interrupted.
|
boolean |
ReentrantReadWriteLock.WriteLock.tryLock(long timeout, TimeUnit
Acquires the write lock if it is not held by another thread within the given waiting time and the current thread has not been
interrupted.
|
long |
StampedLock.tryReadLock(long time, TimeUnit
Non-exclusively acquires the lock if it is available within the given time and the current thread has not been interrupted.
|
long |
StampedLock.tryWriteLock(long time, TimeUnit
Exclusively acquires the lock if it is available within the given time and the current thread has not been interrupted.
|
| Modifier and Type | Method and Description |
|---|---|
T |
SwingWorker.get(long timeout, TimeUnit
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
|