public final class Task
extends java.lang.Object
Task
is the abstraction of the execution
of an application (see javax.microedition.midlet.MIDlet
).
Tasks are started using the
TaskManager.startTask
method, where the arguments specify the application
suite and the class within the suite being the starting point of the application.
Starting new task means attempt to execute corresponding application.
A task has a status as described in the TaskStatus
enumeration, that
describes corresponding application lifecycle state. A task has
a priority with possible values as described in TaskPriority
.
Depending on whether the implementation supports multiple VMs, several tasks can run in parallel or not.
There are special tasks called system tasks. Those tasks cannot be started
or stopped via this API, but are started by the system.
isSystemTask
method can be used to find out whether a
taks is a system task or not.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object task2)
Compares the current task with another
Task instance. |
int |
getHeapUse()
Returns heap use of given task.
|
java.lang.String |
getName()
Convenient method to return the name of the task.
|
TaskPriority |
getPriority()
Returns priority of given task.
|
TaskStatus |
getStatus()
Returns task's status.
|
Suite |
getSuite()
Returns suite information this task executed from.
|
int |
hashCode()
Overrides hashCode() method.
|
boolean |
isSystemTask()
Retrieve information about whether a task is a system task or not.
|
public java.lang.String getName()
null
.public TaskPriority getPriority()
public int getHeapUse()
public TaskStatus getStatus()
public Suite getSuite()
Suite
this task belongs to.public boolean isSystemTask()
true
if the task is a system task,
false
otherwisepublic boolean equals(java.lang.Object task2)
Task
instance.
The task objects are equal if their suites as retrieved by
getSuite()
are equal and their names as retrieved by
getName()
are equal.equals
in class java.lang.Object
task2
- the other Task
object the current one should
be compared withtrue
if the Task
objects are equal,
false
otherwisepublic int hashCode()
getName()
and the suite as retrieved by
getSuite()
.hashCode
in class java.lang.Object
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.