Use 
PREV   NEXT      All Classes   All Packages
FlexDoc/Javadoc 2.0
Demo Java Doc

Uses of Enum
java.util.concurrent.TimeUnit
Packages that use TimeUnit
Provides classes that are fundamental to the design of the Java programming language.
Utility classes commonly useful in concurrent programming.
Uses of TimeUnit in java.lang
Methods in java.lang with parameters of type TimeUnit
boolean
Process.waitFor(long timeout, TimeUnit unit)
Causes the current thread to wait, if necessary, until the process represented by this Process object has terminated, or the specified waiting time elapses.
Class declarations in java.util.concurrent with type arguments of type TimeUnit
enum
A TimeUnit represents time durations at a given unit of granularity and provides utility methods to convert across units, and to perform timing and delay operations in these units.
Fields in java.util.concurrent declared as TimeUnit
TimeUnit.DAYS
Time unit representing twenty four hours.
TimeUnit.HOURS
Time unit representing sixty minutes.
TimeUnit.MICROSECONDS
Time unit representing one thousandth of a millisecond.
TimeUnit.MILLISECONDS
Time unit representing one thousandth of a second.
TimeUnit.MINUTES
Time unit representing sixty seconds.
TimeUnit.NANOSECONDS
Time unit representing one thousandth of a microsecond.
TimeUnit.SECONDS
Time unit representing one second.
Methods in java.util.concurrent that return TimeUnit
static TimeUnit
TimeUnit.of(ChronoUnit chronoUnit)
Converts a ChronoUnit to the equivalent TimeUnit.
static TimeUnit
TimeUnit.valueOf(String name)
static TimeUnit[]
TimeUnit.values()
Methods in java.util.concurrent with parameters of type TimeUnit
AbstractExecutorService.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first.
<TT
AbstractExecutorService.invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
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.
boolean
ArrayBlockingQueue.offer(E e, long timeout, TimeUnit unit)
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.
ArrayBlockingQueue.poll(long timeout, TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
boolean
BlockingDeque.offer(E e, long timeout, TimeUnit unit)
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
BlockingDeque.offerFirst(E e, long timeout, TimeUnit unit)
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
BlockingDeque.offerLast(E e, long timeout, TimeUnit unit)
Inserts the specified element at the end of this deque, waiting up to the specified wait time if necessary for space to become available.
BlockingDeque.poll(long timeout, TimeUnit unit)
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.
BlockingDeque.pollFirst(long timeout, TimeUnit unit)
Retrieves and removes the first element of this deque, waiting up to the specified wait time if necessary for an element to become available.
BlockingDeque.pollLast(long timeout, TimeUnit unit)
Retrieves and removes the last element of this deque, waiting up to the specified wait time if necessary for an element to become available.
boolean
BlockingQueue.offer(E e, long timeout, TimeUnit unit)
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.
BlockingQueue.poll(long timeout, TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
CompletableFuture.completeOnTimeout(T value, long timeout, TimeUnit unit)
Completes this CompletableFuture with the given value if not otherwise completed before the given timeout.
static Executor
CompletableFuture.delayedExecutor(long delay, TimeUnit unit)
Returns a new Executor that submits a task to the default executor after the given delay (or no delay if non-positive).
static Executor
CompletableFuture.delayedExecutor(long delay, TimeUnit unit, Executor executor)
Returns a new Executor that submits a task to the given base executor after the given delay (or no delay if non-positive).
CompletableFuture.get(long timeout, TimeUnit unit)
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
CompletableFuture.orTimeout(long timeout, TimeUnit unit)
Exceptionally completes this CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.
CompletionService.poll(long timeout, TimeUnit unit)
Retrieves and removes the Future representing the next completed task, waiting if necessary up to the specified wait time if none are yet present.
boolean
CountDownLatch.await(long timeout, TimeUnit unit)
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 unit)
Waits until all parties have invoked await on this barrier, or the specified waiting time elapses.
long
Delayed.getDelay(TimeUnit unit)
Returns the remaining delay associated with this object, in the given time unit.
boolean
DelayQueue.offer(E e, long timeout, TimeUnit unit)
Inserts the specified element into this delay queue.
DelayQueue.poll(long timeout, TimeUnit unit)
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.
Exchanger.exchange(V x, long timeout, TimeUnit unit)
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.
ExecutorCompletionService.poll(long timeout, TimeUnit unit)
Retrieves and removes the Future representing the next completed task, waiting if necessary up to the specified wait time if none are yet present.
boolean
ExecutorService.awaitTermination(long timeout, TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
ExecutorService.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first.
<TT
ExecutorService.invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
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.
boolean
ForkJoinPool.awaitQuiescence(long timeout, TimeUnit unit)
If called by a ForkJoinTask operating in this pool, equivalent in effect to ForkJoinTask.helpQuiesce().
boolean
ForkJoinPool.awaitTermination(long timeout, TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
ForkJoinPool.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first.
<TT
ForkJoinPool.invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
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.
final V
ForkJoinTask.get(long timeout, TimeUnit unit)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
Future.get(long timeout, TimeUnit unit)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
FutureTask.get(long timeout, TimeUnit unit)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
boolean
LinkedBlockingDeque.offer(E e, long timeout, TimeUnit unit)
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
LinkedBlockingDeque.offerFirst(E e, long timeout, TimeUnit unit)
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 unit)
Inserts the specified element at the end of this deque, waiting up to the specified wait time if necessary for space to become available.
LinkedBlockingDeque.poll(long timeout, TimeUnit unit)
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.
LinkedBlockingDeque.pollFirst(long timeout, TimeUnit unit)
Retrieves and removes the first element of this deque, waiting up to the specified wait time if necessary for an element to become available.
LinkedBlockingDeque.pollLast(long timeout, TimeUnit unit)
Retrieves and removes the last element of this deque, waiting up to the specified wait time if necessary for an element to become available.
boolean
LinkedBlockingQueue.offer(E e, long timeout, TimeUnit unit)
Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.
LinkedBlockingQueue.poll(long timeout, TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
boolean
LinkedTransferQueue.offer(E e, long timeout, TimeUnit unit)
Inserts the specified element at the tail of this queue.
LinkedTransferQueue.poll(long timeout, TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
boolean
LinkedTransferQueue.tryTransfer(E e, long timeout, TimeUnit unit)
Transfers the element to a consumer if it is possible to do so before the timeout elapses.
int
Phaser.awaitAdvanceInterruptibly(int phase, long timeout, TimeUnit unit)
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
PriorityBlockingQueue.offer(E e, long timeout, TimeUnit unit)
Inserts the specified element into this priority queue.
PriorityBlockingQueue.poll(long timeout, TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
ScheduledExecutorService.schedule(Callable<V> callable, long delay, TimeUnit unit)
Submits a value-returning one-shot task that becomes enabled after the given delay.
ScheduledExecutorService.schedule(Runnable command, long delay, TimeUnit unit)
Submits a one-shot task that becomes enabled after the given delay.
ScheduledExecutorService.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
Submits 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.
ScheduledExecutorService.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
Submits 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.
ScheduledThreadPoolExecutor.schedule(Callable<V> callable, long delay, TimeUnit unit)
Submits a value-returning one-shot task that becomes enabled after the given delay.
ScheduledThreadPoolExecutor.schedule(Runnable command, long delay, TimeUnit unit)
Submits a one-shot task that becomes enabled after the given delay.
ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
Submits 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.
ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
Submits 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.
boolean
Semaphore.tryAcquire(int permits, long timeout, TimeUnit unit)
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 unit)
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.
int
SubmissionPublisher.offer(T item, long timeout, TimeUnit unit, BiPredicate<Flow.Subscriber<? super T>,? super T> onDrop)
Publishes the given item, if possible, to each current subscriber by asynchronously invoking its onNext method, blocking while resources for any subscription are unavailable, up to the specified timeout or until the caller thread is interrupted, at which point the given handler (if non-null) is invoked, and if it returns true, retried once.
boolean
SynchronousQueue.offer(E e, long timeout, TimeUnit unit)
Inserts the specified element into this queue, waiting if necessary up to the specified wait time for another thread to receive it.
SynchronousQueue.poll(long timeout, TimeUnit unit)
Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it.
boolean
ThreadPoolExecutor.awaitTermination(long timeout, TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
long
ThreadPoolExecutor.getKeepAliveTime(TimeUnit unit)
Returns the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated.
void
ThreadPoolExecutor.setKeepAliveTime(long time, TimeUnit unit)
Sets the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated.
long
TimeUnit.convert(long sourceDuration, TimeUnit sourceUnit)
Converts the given time duration in the given unit to this unit.
boolean
TransferQueue.tryTransfer(E e, long timeout, TimeUnit unit)
Transfers the element to a consumer if it is possible to do so before the timeout elapses.
Constructors in java.util.concurrent with parameters of type TimeUnit
ForkJoinPool(int parallelism, ForkJoinPool.ForkJoinWorkerThreadFactory factory, Thread.UncaughtExceptionHandler handler, boolean asyncMode, int corePoolSize, int maximumPoolSize, int minimumRunnable, Predicate<? super ForkJoinPool> saturate, long keepAliveTime, TimeUnit unit)
Creates a ForkJoinPool with the given parameters.
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)
Creates a new ThreadPoolExecutor with the given initial parameters, the default thread factory and the default rejected execution handler.
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
Creates a new ThreadPoolExecutor with the given initial parameters and the default thread factory.
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Creates a new ThreadPoolExecutor with the given initial parameters and the default rejected execution handler.
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)
Creates a new ThreadPoolExecutor with the given initial parameters.

 Use 
PREV   NEXT      All Classes   All Packages
FlexDoc/Javadoc 2.0
Demo Java Doc

Java API documentation generated with FlexDoc/Javadoc 2.0 using JavadocClassic 3.0 template set.
FlexDoc/Javadoc is a template-driven programming tool for rapid development of any Javadoc-based Java API documentation generators (i.e. doclets). If you need to customize your Javadoc without writing a full-blown doclet from scratch, FlexDoc/Javadoc may be the only tool able to help you! Find out more at www.flexdoc.xyz