abstract class CollectionFuture<V,C> extends AggregateFuture<V,C>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
CollectionFuture.ListFuture<V>
|
private static class |
CollectionFuture.Present<V>
The result of a successful
Future . |
AggregateFuture.ReleaseResourcesReason
AbstractFuture.Trusted<V>, AbstractFuture.TrustedFuture<V>
Modifier and Type | Field and Description |
---|---|
private java.util.List<CollectionFuture.Present<V>> |
values |
GENERATE_CANCELLATION_CAUSES
Constructor and Description |
---|
CollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
boolean allMustSucceed) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
collectOneValue(int index,
V returnValue)
If
allMustSucceed is true, called as each future completes; otherwise, if collectsValues is true, called for each future when all futures complete. |
(package private) abstract C |
combine(java.util.List<CollectionFuture.Present<V>> values) |
(package private) void |
handleAllCompleted() |
(package private) void |
releaseResources(AggregateFuture.ReleaseResourcesReason reason)
Clears fields that are no longer needed after this future has completed -- or at least all its
inputs have completed (more precisely, after
AggregateFuture.handleAllCompleted() has been called). |
addInitialException, afterDone, init, pendingToString
clearSeenExceptions, decrementRemainingAndGet, getOrInitSeenExceptions
addListener, cancel, get, get, isCancelled, isDone
interruptTask, maybePropagateCancellationTo, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
@CheckForNull private java.util.List<CollectionFuture.Present<V>> values
CollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
final void collectOneValue(int index, V returnValue)
AggregateFuture
allMustSucceed
is true, called as each future completes; otherwise, if collectsValues
is true, called for each future when all futures complete.collectOneValue
in class AggregateFuture<V,C>
final void handleAllCompleted()
handleAllCompleted
in class AggregateFuture<V,C>
void releaseResources(AggregateFuture.ReleaseResourcesReason reason)
AggregateFuture
AggregateFuture.handleAllCompleted()
has been called).
Often called multiple times (that is, both when the inputs complete and when the output
completes).
This is similar to our proposed afterCommit
method but not quite the same. See the
description of CL 265462958.
releaseResources
in class AggregateFuture<V,C>
abstract C combine(java.util.List<CollectionFuture.Present<V>> values)