Class CollectionFuture<V,C>
java.lang.Object
com.google.common.util.concurrent.internal.InternalFutureFailureAccess
com.google.common.util.concurrent.AbstractFuture<C>
com.google.common.util.concurrent.AbstractFuture.TrustedFuture<C>
com.google.common.util.concurrent.AggregateFutureState<C>
com.google.common.util.concurrent.AggregateFuture<V,C>
com.google.common.util.concurrent.CollectionFuture<V,C>
- All Implemented Interfaces:
AbstractFuture.Trusted<C>,ListenableFuture<C>,Future<C>
- Direct Known Subclasses:
CollectionFuture.ListFuture
Aggregate future that collects (stores) results of each future.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classprivate static final classThe result of a successfulFuture.Nested classes/interfaces inherited from class com.google.common.util.concurrent.AggregateFuture
AggregateFuture.ReleaseResourcesReasonNested classes/interfaces inherited from class com.google.common.util.concurrent.AbstractFuture
AbstractFuture.Trusted<V>, AbstractFuture.TrustedFuture<V>Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsFields inherited from class com.google.common.util.concurrent.AbstractFuture
GENERATE_CANCELLATION_CAUSES -
Constructor Summary
ConstructorsConstructorDescriptionCollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed) -
Method Summary
Modifier and TypeMethodDescription(package private) final voidcollectOneValue(int index, V returnValue) IfallMustSucceedis true, called as each future completes; otherwise, ifcollectsValuesis true, called for each future when all futures complete.(package private) abstract Ccombine(List<CollectionFuture.Present<V>> values) (package private) final void(package private) voidClears fields that are no longer needed after this future has completed -- or at least all its inputs have completed (more precisely, afterAggregateFuture.handleAllCompleted()has been called).Methods inherited from class com.google.common.util.concurrent.AggregateFuture
addInitialException, afterDone, init, pendingToStringMethods inherited from class com.google.common.util.concurrent.AggregateFutureState
clearSeenExceptions, decrementRemainingAndGet, getOrInitSeenExceptionsMethods inherited from class com.google.common.util.concurrent.AbstractFuture.TrustedFuture
addListener, cancel, get, get, isCancelled, isDoneMethods inherited from class com.google.common.util.concurrent.AbstractFuture
interruptTask, maybePropagateCancellationTo, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterruptedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
values
-
-
Constructor Details
-
CollectionFuture
CollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
-
-
Method Details
-
collectOneValue
Description copied from class:AggregateFutureIfallMustSucceedis true, called as each future completes; otherwise, ifcollectsValuesis true, called for each future when all futures complete.- Specified by:
collectOneValuein classAggregateFuture<V,C>
-
handleAllCompleted
final void handleAllCompleted()- Specified by:
handleAllCompletedin classAggregateFuture<V,C>
-
releaseResources
Description copied from class:AggregateFutureClears fields that are no longer needed after this future has completed -- or at least all its inputs have completed (more precisely, afterAggregateFuture.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
afterCommitmethod but not quite the same. See the description of CL 265462958.- Overrides:
releaseResourcesin classAggregateFuture<V,C>
-
combine
-