ScheduledFuture
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
|
A delayed result-bearing action that can be cancelled.
Usually a scheduled future is the result of scheduling
a task with a ScheduledExecutorService
.
Inherited Method Summary
From interface
java.util.concurrent.Future
abstract
boolean
|
cancel(boolean mayInterruptIfRunning)
Attempts to cancel execution of this task.
|
abstract
V
|
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.
|
abstract
V
|
get()
Waits if necessary for the computation to complete, and then
retrieves its result.
|
abstract
boolean
|
isCancelled()
Returns true if this task was cancelled before it completed
normally.
|
abstract
boolean
|
isDone()
Returns true if this task completed.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`ScheduledFuture` represents a delayed result-bearing action that can be cancelled, typically used for scheduling tasks."],["It extends the `Delayed` and `Future` interfaces, providing methods to manage delays, cancellation, and retrieval of results."],["`ScheduledExecutorService` is commonly used to create and manage instances of `ScheduledFuture`."],["The interface includes methods inherited from `Delayed`, `Future`, and `Comparable` for comprehensive task management."]]],["`ScheduledFuture` is a cancellable, delayed action that produces a result, often from `ScheduledExecutorService`. It inherits methods to manage its state and retrieve results: `cancel`, `get` (with/without timeout), `isCancelled`, and `isDone`. It also features `getDelay` to check remaining delay time and `compareTo` for ordering, and `RunnableScheduledFuture` as subclass, that is a `Runnable`.\n"]]