共用方式為


AbstractExecutorService.NewTaskFor Method

Definition

Overloads

NewTaskFor(ICallable)

Returns a RunnableFuture for the given callable task.

NewTaskFor(IRunnable, Object)

Returns a RunnableFuture for the given runnable and default value.

NewTaskFor(ICallable)

Returns a RunnableFuture for the given callable task.

[Android.Runtime.Register("newTaskFor", "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/RunnableFuture;", "GetNewTaskFor_Ljava_util_concurrent_Callable_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
protected virtual Java.Util.Concurrent.IRunnableFuture? NewTaskFor (Java.Util.Concurrent.ICallable? callable);
[<Android.Runtime.Register("newTaskFor", "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/RunnableFuture;", "GetNewTaskFor_Ljava_util_concurrent_Callable_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member NewTaskFor : Java.Util.Concurrent.ICallable -> Java.Util.Concurrent.IRunnableFuture
override this.NewTaskFor : Java.Util.Concurrent.ICallable -> Java.Util.Concurrent.IRunnableFuture

Parameters

callable
ICallable

the callable task being wrapped

Returns

a RunnableFuture which, when run, will call the underlying callable and which, as a Future, will yield the callable's result as its result and provide for cancellation of the underlying task

Attributes

Remarks

Returns a RunnableFuture for the given callable task.

Added in 1.6.

Java documentation for java.util.concurrent.AbstractExecutorService.newTaskFor(java.util.concurrent.Callable<T>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

NewTaskFor(IRunnable, Object)

Returns a RunnableFuture for the given runnable and default value.

[Android.Runtime.Register("newTaskFor", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/RunnableFuture;", "GetNewTaskFor_Ljava_lang_Runnable_Ljava_lang_Object_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
protected virtual Java.Util.Concurrent.IRunnableFuture? NewTaskFor (Java.Lang.IRunnable? runnable, Java.Lang.Object? value);
[<Android.Runtime.Register("newTaskFor", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/RunnableFuture;", "GetNewTaskFor_Ljava_lang_Runnable_Ljava_lang_Object_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member NewTaskFor : Java.Lang.IRunnable * Java.Lang.Object -> Java.Util.Concurrent.IRunnableFuture
override this.NewTaskFor : Java.Lang.IRunnable * Java.Lang.Object -> Java.Util.Concurrent.IRunnableFuture

Parameters

runnable
IRunnable

the runnable task being wrapped

value
Object

the default value for the returned future

Returns

a RunnableFuture which, when run, will run the underlying runnable and which, as a Future, will yield the given value as its result and provide for cancellation of the underlying task

Attributes

Remarks

Returns a RunnableFuture for the given runnable and default value.

Added in 1.6.

Java documentation for java.util.concurrent.AbstractExecutorService.newTaskFor(java.lang.Runnable, T).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to