
public abstract class Task extends Object implements Cloneable, Serializable
A task is a sequence of operations taking time. This class defines
properties to be used by applications to query a task for information and for
canceling a task. Property indeterminate indicates if a task
supports properties minimum, maximum and progress.
Property cancelable indicates if a task may be canceled by an
application by setting property cancelled to true.
Properties description and progressDescription hold
presentation descriptions of a task itself and of the work currently
performed by a task.
TaskEvent,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static Comparator |
ASCENDING
Comparator for sorting tasks in ascending order of creation time.
|
protected boolean |
cancelable
Flag indicating that an application may cancel the task.
|
static Comparator |
DESCENDING
Comparator for sorting tasks in descending order of creation time.
|
protected Message |
description
Description of the
Task. |
protected boolean |
indeterminate
Flag indicating if the operations performed by the task are of unknown
length.
|
protected int |
maximum
The upper bound of the range.
|
protected int |
minimum
The lower bound of the range.
|
protected int |
progress
Indicates the progress of the task.
|
protected Message |
progressDescription
Description of the progress of the
Task. |
| Constructor and Description |
|---|
Task()
Creates a new
Task instance. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
equals(Object o)
Indicates whether some other object is equal to this one.
|
Message |
getDescription()
Getter for property
description. |
int |
getMaximum()
Gets the higher end of the progress value.
|
int |
getMinimum()
Gets the lower end of the progress value.
|
int |
getProgress()
Gets the progress of the task.
|
Message |
getProgressDescription()
Getter for property
progressDescription. |
long |
getTimestamp()
Getter for property
timestamp. |
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isCancelable()
Flag indicating that the task supports property
cancelled. |
boolean |
isCancelled()
Flag indicating that the task is canceled.
|
boolean |
isIndeterminate()
Flag indicating if the task supports properties
minimum,
maximum and progress. |
void |
setCancelled(boolean value)
Setter for property
cancelled. |
String |
toString()
Returns a string representation of the object.
|
public static final Comparator ASCENDING
Note:
This comparator imposes orderings that are inconsistent with equals.
protected boolean cancelable
public static final Comparator DESCENDING
Note:
This comparator imposes orderings that are inconsistent with equals.
protected Message description
Task.protected boolean indeterminate
protected int maximum
protected int minimum
protected int progress
protected Message progressDescription
Task.public Task()
Task instance.public final boolean equals(Object o)
Tasks internally cary a UID which is created during instantiation.
This UID is used for comparing o with the instance.
public final Message getDescription()
description.public final int getMaximum()
IllegalStateException - if the task is indeterminate.public final int getMinimum()
IllegalStateException - if the task is indeterminate.public final int getProgress()
IllegalStateException - if the task is indeterminate.public final Message getProgressDescription()
progressDescription.null.public final long getTimestamp()
timestamp.public final int hashCode()
public final boolean isCancelable()
cancelled.true if the task supports property cancelled;
false if property cancelled is ignored by the task.public final boolean isCancelled()
true if the task is canceled; false else.IllegalStateException - if the task is not cancelable.public final boolean isIndeterminate()
minimum,
maximum and progress.true if the operations performed by the task are of
unknown length; false if properties minimum,
maximum and progress hold progress information.public final void setCancelled(boolean value)
cancelled.
Applications may request cancellation of a Task by setting
property cancelled to true. Implementations indicate
support for task cancellation by property cancelable.
value - true to cancel the task; false else.IllegalStateException - if the task is not cancelable or is already
canceled.Copyright © 2005-2012 jDTAUS. All Rights Reserved.