@UnstableApi
public final class CountDownFuture extends AbstractFuture<Void>

java.lang.Object
   ↳ com.google.common.util.concurrent.internal.InternalFutureFailureAccess
     ↳ com.google.common.util.concurrent.AbstractFuture<Void>
       ↳ androidx.media3.test.utils.CountDownFuture

A ListenableFuture that completes when countDown has been called a specified number of times.

Summary

Public constructors

CountDownFuture(int count)

Creates an instance initialized with the specified count.

Public methods

void

Decrements the remaining count, completing the future when it reaches 0.

Inherited methods

From com.google.common.util.concurrent.AbstractFuture
void
addListener(Runnable listener, Executor executor)
void
boolean
cancel(boolean mayInterruptIfRunning)
V
get(long timeout, TimeUnit unit)
void
boolean
boolean
String
boolean
set(V value)
boolean
boolean
String
final Throwable
final boolean
From java.util.concurrent.Future

Public constructors

CountDownFuture

public CountDownFuture(int count)

Creates an instance initialized with the specified count.

Parameters
int count

The number of times countDown must be invoked before completing. If 0, the future completes immediately.

Throws
java.lang.IllegalArgumentException

if count is negative.

Public methods

countDown

public void countDown()

Decrements the remaining count, completing the future when it reaches 0.