com.jme3.app
Class AppTask<V>
java.lang.Object
com.jme3.app.AppTask<V>
- All Implemented Interfaces:
- java.util.concurrent.Future<V>
public class AppTask<V>
- extends java.lang.Object
- implements java.util.concurrent.Future<V>
AppTask
is used in AppTaskQueue
to manage tasks that have
yet to be accomplished. The AppTask system is used to execute tasks either
in the OpenGL/Render thread, or outside of it.
Constructor Summary |
AppTask(java.util.concurrent.Callable<V> callable)
Create an AppTask that will execute the given
Callable . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AppTask
public AppTask(java.util.concurrent.Callable<V> callable)
- Create an
AppTask
that will execute the given
Callable
.
- Parameters:
callable
- The callable to be executed
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface java.util.concurrent.Future<V>
get
public V get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
- Specified by:
get
in interface java.util.concurrent.Future<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
get
public V get(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
- Specified by:
get
in interface java.util.concurrent.Future<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface java.util.concurrent.Future<V>
isDone
public boolean isDone()
- Specified by:
isDone
in interface java.util.concurrent.Future<V>
getCallable
public java.util.concurrent.Callable<V> getCallable()
invoke
public void invoke()