| |
|
| java.lang.Object org.netbeans.microedition.util.SimpleCancellableTask
SimpleCancellableTask | public class SimpleCancellableTask implements CancellableTask(Code) | | A simple implementation of CancellableTask . This implementation uses a supplied
Runnable object, which is being run when this task starts.
author: breh |
Method Summary | |
public boolean | cancel() Cancel this task. | public String | getFailureMessage() Gets the failure message of the failed task. | public boolean | hasFailed() Checks whether the task has failed. | public void | run() Implementation of run method. | public void | setExecutable(Executable executable) Sets the executable object for this task. |
SimpleCancellableTask | public SimpleCancellableTask()(Code) | | Creates a new instance of SimpleCancellableTask
|
SimpleCancellableTask | public SimpleCancellableTask(Executable executable)(Code) | | Creates a new instance of SimpleCancellableTask with supplied executable
object
Parameters: executable - Executable to be used for execution. |
cancel | public boolean cancel()(Code) | | Cancel this task. In this implementation this method does not cancel the runnable
task, this it always returns false.
always returns false |
getFailureMessage | public String getFailureMessage()(Code) | | Gets the failure message of the failed task. Since this implementation considers
as a failure an exception from the Runnable object (more exactly run()
method), this methods returns a message from this exception.
Message from failure exception |
hasFailed | public boolean hasFailed()(Code) | | Checks whether the task has failed. In this implementation this means
the the execute() method of the supplied Executable object has
thrown an exception.
true when the task has failed. |
run | public void run()(Code) | | Implementation of run method. This method basically calls execute() method
from the suplied Executable object.
|
setExecutable | public void setExecutable(Executable executable)(Code) | | Sets the executable object for this task. Also resets the failure message
and the failure state.
Parameters: executable - Executable to be used for execution. |
|
|
|