Package jsr166.impl
Class ContextualCancellableCompleterBoundedAction.CompletableBoundedAction
java.lang.Object
jsr166.impl.ContextualCancellableCompleterBoundedAction.CompletableBoundedAction
- Enclosing class:
- ContextualCancellableCompleterBoundedAction
public abstract static class ContextualCancellableCompleterBoundedAction.CompletableBoundedAction
extends Object
An action to be executed asynchronously on some data that can be divided into ranges.
This action will be executed, possibly concurrently, on sub-ranges of the global data that are no larger than the requested threshold. The action is guaranteed to be called exactly once on each part of the data.
This action should also contain the data on which it is executed.
- Author:
- ActiveViam
-
Method Summary
Modifier and TypeMethodDescriptionabstract voidexecute(ContextualCancellableCountedCompleter<?> completer, int from, int to) Asynchronously executes the action on the given range.intgetSize()Returns the size of the data being processed.intReturns the size under which the work is not split into sub-tasks anymore.
-
Method Details
-
getSize
public int getSize()Returns the size of the data being processed.- Returns:
- The size of the data being processed
-
getThreshold
public int getThreshold()Returns the size under which the work is not split into sub-tasks anymore.- Returns:
- The size under which the work is not split into sub-tasks anymore.
-
execute
public abstract void execute(ContextualCancellableCountedCompleter<?> completer, int from, int to) throws Exception Asynchronously executes the action on the given range.- Parameters:
completer- Our completerfrom- The first index (inclusive) of the range to process.to- The last index (exclusive) of the range to process.- Throws:
Exception- if an exception happened during the computation
-