## Uses of Interface
java.lang.Runnable

- Packages that use Runnable
  Package | Description
  --- | ---
  java.lang |
  java.util |
  java.util.concurrent | Utility classes commonly useful in concurrent programming.
  java.util.stream | Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.
  org.netbeans.modules.openide.util |
  org.openide.util.lookup | Support classes for the Registration and `Lookup` extension mechanism.

- - ### Uses of Runnable in java.lang

    Classes in java.lang that implement Runnable
    Modifier and Type | Class and Description
    --- | ---
    `class` | `Thread` A thread is a thread of execution in a program.

    Constructors in java.lang with parameters of type Runnable
    Constructor and Description
    `Thread(Runnable target)` Allocates a new `Thread` object.
    `Thread(Runnable target, String name)` Allocates a new `Thread` object.

  - ### Uses of Runnable in java.util

    Classes in java.util that implement Runnable
    Modifier and Type | Class and Description
    --- | ---
    `class` | `TimerTask` A task that can be scheduled for one-time or repeated execution by a Timer.

    Methods in java.util with parameters of type Runnable
    Modifier and Type | Method and Description
    --- | ---
    `void` | Optional.`ifPresentOrElse(Consumer<? super T> action, Runnable emptyAction)` If a value is present, performs the given action with the value, otherwise performs the given empty-based action.

  - ### Uses of Runnable in java.util.concurrent

    Subinterfaces of Runnable in java.util.concurrent
    Modifier and Type | Interface and Description
    --- | ---
    `interface` | `RunnableFuture<V>` A `Future` that is `Runnable`.
    `interface` | `RunnableScheduledFuture<V>` A `ScheduledFuture` that is `Runnable`.

    Classes in java.util.concurrent that implement Runnable
    Modifier and Type | Class and Description
    --- | ---
    `class` | `ForkJoinWorkerThread` A thread managed by a `ForkJoinPool`, which executes `ForkJoinTask`s.
    `class` | `FutureTask<V>` A cancellable asynchronous computation.

    Methods in java.util.concurrent that return types with arguments of type Runnable
    Modifier and Type | Method and Description
    --- | ---
    `BlockingQueue<Runnable>` | ThreadPoolExecutor.`getQueue()` Returns the task queue used by this executor.
    `BlockingQueue<Runnable>` | ScheduledThreadPoolExecutor.`getQueue()` Returns the task queue used by this executor.
    `List<Runnable>` | ThreadPoolExecutor.`shutdownNow()` Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.
    `List<Runnable>` | ScheduledThreadPoolExecutor.`shutdownNow()` Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.
    `List<Runnable>` | ForkJoinPool.`shutdownNow()` Attempts to cancel and/or stop all tasks, and reject all subsequently submitted tasks.
    `List<Runnable>` | ExecutorService.`shutdownNow()` Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.

    Methods in java.util.concurrent with parameters of type Runnable
    Modifier and Type | Method and Description
    --- | ---
    `static ForkJoinTask<?>` | ForkJoinTask.`adapt(Runnable runnable)` Returns a new `ForkJoinTask` that performs the `run` method of the given `Runnable` as its action, and returns a null result upon `ForkJoinTask.join()`.
    `static <T> ForkJoinTask<T>` | ForkJoinTask.`adapt(Runnable runnable, T result)` Returns a new `ForkJoinTask` that performs the `run` method of the given `Runnable` as its action, and returns the given result upon `ForkJoinTask.join()`.
    `protected void` | ThreadPoolExecutor.`afterExecute(Runnable r, Throwable t)` Method invoked upon completion of execution of the given Runnable.
    `protected void` | ThreadPoolExecutor.`beforeExecute(Thread t, Runnable r)` Method invoked prior to executing the given Runnable in the given thread.
    `static Callable<Object>` | Executors.`callable(Runnable task)` Returns a `Callable` object that, when called, runs the given task and returns `null`.
    `static <T> Callable<T>` | Executors.`callable(Runnable task, T result)` Returns a `Callable` object that, when called, runs the given task and returns the given result.
    `protected <V> RunnableScheduledFuture<V>` | ScheduledThreadPoolExecutor.`decorateTask(Runnable runnable, RunnableScheduledFuture<V> task)` Modifies or replaces the task used to execute a runnable.
    `void` | ThreadPoolExecutor.`execute(Runnable command)` Executes the given task sometime in the future.
    `void` | ScheduledThreadPoolExecutor.`execute(Runnable command)` Executes `command` with zero required delay.
    `void` | ForkJoinPool.`execute(Runnable task)`
    `void` | Executor.`execute(Runnable command)` Executes the given command at some time in the future.
    `protected <T> RunnableFuture<T>` | ForkJoinPool.`newTaskFor(Runnable runnable, T value)`
    `protected <T> RunnableFuture<T>` | AbstractExecutorService.`newTaskFor(Runnable runnable, T value)` Returns a `RunnableFuture` for the given runnable and default value.
    `Thread` | ThreadFactory.`newThread(Runnable r)` Constructs a new `Thread`.
    `void` | ThreadPoolExecutor.CallerRunsPolicy.`rejectedExecution(Runnable r, ThreadPoolExecutor e)` Executes task r in the caller's thread, unless the executor has been shut down, in which case the task is discarded.
    `void` | ThreadPoolExecutor.AbortPolicy.`rejectedExecution(Runnable r, ThreadPoolExecutor e)` Always throws RejectedExecutionException.
    `void` | ThreadPoolExecutor.DiscardPolicy.`rejectedExecution(Runnable r, ThreadPoolExecutor e)` Does nothing, which has the effect of discarding task r.
    `void` | ThreadPoolExecutor.DiscardOldestPolicy.`rejectedExecution(Runnable r, ThreadPoolExecutor e)` Obtains and ignores the next task that the executor would otherwise execute, if one is immediately available, and then retries execution of task r, unless the executor is shut down, in which case task r is instead discarded.
    `void` | RejectedExecutionHandler.`rejectedExecution(Runnable r, ThreadPoolExecutor executor)` Method that may be invoked by a `ThreadPoolExecutor` when `execute` cannot accept a task.
    `boolean` | ThreadPoolExecutor.`remove(Runnable task)` Removes this task from the executor's internal queue if it is present, thus causing it not to be run if it has not already started.
    `ScheduledFuture<?>` | ScheduledThreadPoolExecutor.`schedule(Runnable command, long delay, TimeUnit unit)`
    `ScheduledFuture<?>` | ScheduledExecutorService.`schedule(Runnable command, long delay, TimeUnit unit)` Creates and executes a one-shot action that becomes enabled after the given delay.
    `ScheduledFuture<?>` | ScheduledThreadPoolExecutor.`scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)`
    `ScheduledFuture<?>` | ScheduledExecutorService.`scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)` 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 command, long initialDelay, long delay, TimeUnit unit)`
    `ScheduledFuture<?>` | ScheduledExecutorService.`scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)` 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.
    `Future<?>` | ScheduledThreadPoolExecutor.`submit(Runnable task)`
    `ForkJoinTask<?>` | ForkJoinPool.`submit(Runnable task)`
    `Future<?>` | ExecutorService.`submit(Runnable task)` Submits a Runnable task for execution and returns a Future representing that task.
    `Future<?>` | AbstractExecutorService.`submit(Runnable task)`
    `<T> Future<T>` | ScheduledThreadPoolExecutor.`submit(Runnable task, T result)`
    `<T> ForkJoinTask<T>` | ForkJoinPool.`submit(Runnable task, T result)`
    `<T> Future<T>` | ExecutorService.`submit(Runnable task, T result)` Submits a Runnable task for execution and returns a Future representing that task.
    `<T> Future<T>` | AbstractExecutorService.`submit(Runnable task, T result)`
    `Future<V>` | ExecutorCompletionService.`submit(Runnable task, V result)`
    `Future<V>` | CompletionService.`submit(Runnable task, V result)` Submits a Runnable task for execution and returns a Future representing that task.

    Constructors in java.util.concurrent with parameters of type Runnable
    Constructor and Description
    `CyclicBarrier(int parties, Runnable barrierAction)` Creates a new `CyclicBarrier` that will trip when the given number of parties (threads) are waiting upon it, and which will execute the given barrier action when the barrier is tripped, performed by the last thread entering the barrier.
    `FutureTask(Runnable runnable, V result)` Creates a `FutureTask` that will, upon running, execute the given `Runnable`, and arrange that `get` will return the given result on successful completion.

    Constructor parameters in java.util.concurrent with type arguments of type Runnable
    Constructor and Description
    `ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)` 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 unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)` Creates a new `ThreadPoolExecutor` with the given initial parameters and 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 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.

  - ### Uses of Runnable in java.util.stream

    Methods in java.util.stream with parameters of type Runnable
    Modifier and Type | Method and Description
    --- | ---
    `S` | BaseStream.`onClose(Runnable closeHandler)` Returns an equivalent stream with an additional close handler.

  - ### Uses of Runnable in org.netbeans.modules.openide.util

    Methods in org.netbeans.modules.openide.util with parameters of type Runnable
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | GlobalLookup.`execute(Lookup defaultLookup, Runnable r)`

  - ### Uses of Runnable in org.openide.util.lookup

    Methods in org.openide.util.lookup with parameters of type Runnable
    Modifier and Type | Method and Description
    --- | ---
    `static void` | Lookups.`executeWith(Lookup defaultLookup, Runnable code)` Temporarily (while the `code` is running) changes value of `Lookup.getDefault()` to here-in provided lookup.

Copyright © 2025 API Design. All Rights Reserved.