public class

FutureValues.SettableFutureValue<T>

extends java.lang.Object

implements FutureValue<java.lang.Object>

 java.lang.Object

↳androidx.pdf.data.FutureValues.SettableFutureValue<T>

Overview

A FutureValue that accepts multiple FutureValue.Callbacks and can be set.

Summary

Constructors
publicSettableFutureValue()

Methods
public voidfail(java.lang.String errorMessage)

Wraps a java.lang.String error message in an java.lang.Exception.

public voidfail(java.lang.Throwable thrown)

Set the exception thrown while getting the value.

public voidget(FutureValue.Callback<java.lang.Object> callback)

public booleanisSet()

public voidprogress(float progress)

Notify all the callbacks of a progress update.

public voidset(java.lang.Object value)

Set the successful value resulting from the asynchronous operation.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public SettableFutureValue()

Methods

public void set(java.lang.Object value)

Set the successful value resulting from the asynchronous operation. Any callbacks will be called immediately. The value will be retained to call any new callbacks. All callback references will be removed.

Parameters:

value: The result of the asynchronous operation.

public void progress(float progress)

Notify all the callbacks of a progress update. This implementation will not store intermediate progress values. So if a callback is registered after the last progress value has been sent, it will not get the previous progress values. Progress is no longer reported after this future completes (i.e. if FutureValues.SettableFutureValue.isSet()).

Parameters:

progress: is a measure of how much progress has been done [0-1].

public void fail(java.lang.Throwable thrown)

Set the exception thrown while getting the value. Any callbacks will be called immediately. The exception will be retained to call any new callbacks. All callback references will be removed.

Parameters:

thrown: The problem encountered while getting the result of the asynchronous operation.

public void fail(java.lang.String errorMessage)

Wraps a java.lang.String error message in an java.lang.Exception. Otherwise, it has the same behaviour as FutureValues.SettableFutureValue.fail(Throwable).

public void get(FutureValue.Callback<java.lang.Object> callback)

public boolean isSet()