org.gvsig.tools.task.impl
Class BaseTaskStatus

java.lang.Object
  extended by org.gvsig.tools.task.impl.BaseTaskStatus
All Implemented Interfaces:
Observable, CancellableTask, SimpleTaskStatus, TaskStatus

public class BaseTaskStatus
extends Object
implements SimpleTaskStatus

Version:
$Id$
Author:
gvSIG Team

Field Summary
protected  String code
           
protected  long curValue
           
protected  boolean isAbortedByError
           
protected  boolean isCancelled
           
protected  boolean isRunning
           
protected  TaskStatusManager manager
           
protected  long maxValue
           
protected  String message
           
protected  long minValue
           
protected  String title
           
 
Constructor Summary
BaseTaskStatus(String tittle)
           
BaseTaskStatus(String tittle, long minValue, long maxValue)
           
 
Method Summary
 void abort()
          Used by the task to inform that it has terminated with errors.
 void add()
          Add this TaskStatus to the TaskStatusManager.
 void addObserver(Observer o)
           
 void cancel()
          Used by the task to inform that it has terminated cancelled by the user or another task.
 void cancelRequest()
          Request to the task that cancel.
 void deleteObserver(Observer o)
           
 void deleteObservers()
           
 boolean getAutoRemove()
          Return the autoremove value of this TaskStatus.
 String getCode()
          Gte the code of this TaskStatus.
 int getCompleted()
          Retorna el porcentaje de completitud de la tarea asociada a este TaskStatus.
 String getLabel()
          Get a label that represent the status of the task
 Date getLastModification()
          Returns date of last modificaction of status.
 TaskStatusManager getManager()
          Return the TaskStatusManager associated to this TaskStatus.
 String getTitle()
          Get the title associated to the task of this TaskStatus
 boolean isAborted()
          Return true if the task has terminated with errors.
 boolean isCancellable()
          Return true if the task associated to this TaskStatus can be canceled.
 boolean isCancellationRequested()
          Return true if has request to cancel to the task.
 boolean isCancelled()
          Return true if the task has cancelled by the user or another task.
 boolean isIndeterminate()
          Return true if the completion of this task can't calculate.
 boolean isRunning()
          Return true if the task is running.
 void message(String message)
          Used by the task to set a message associated to the current action of the task
 void remove()
          Remove this TaskStatus from the TaskStatusManager
 void setAutoremove(boolean autoremove)
          Used by the task to inform that this TaskStatus is removed from the manager automatically when the task is terminated and the manager need.
 void setCancellable(boolean cancellable)
          Used by the task to inform that this task es cacellable.
 void setCurValue(long value)
          Used by the task to set the current step of the task.
 void setRangeOfValues(long min, long max)
          Used by the task to set the value for min and max steps of the task.
 void setTitle(String title)
          Used by the task to set the title associated to the task.
 void setTittle(String tittle)
          Used by the task to set the title associated to the task.
 void terminate()
          Used by the task to inform that it has terminated without errors.
protected  void touch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minValue

protected long minValue

maxValue

protected long maxValue

curValue

protected long curValue

title

protected String title

code

protected String code

message

protected String message

isCancelled

protected boolean isCancelled

isAbortedByError

protected boolean isAbortedByError

isRunning

protected boolean isRunning

manager

protected TaskStatusManager manager
Constructor Detail

BaseTaskStatus

public BaseTaskStatus(String tittle)

BaseTaskStatus

public BaseTaskStatus(String tittle,
                      long minValue,
                      long maxValue)
Method Detail

setRangeOfValues

public void setRangeOfValues(long min,
                             long max)
Description copied from interface: SimpleTaskStatus
Used by the task to set the value for min and max steps of the task. These are used with the "curvalue" to calculate the percentage of completion.

Specified by:
setRangeOfValues in interface SimpleTaskStatus

touch

protected void touch()

getLastModification

public Date getLastModification()
Description copied from interface: TaskStatus
Returns date of last modificaction of status.

Specified by:
getLastModification in interface TaskStatus
Returns:

message

public void message(String message)
Description copied from interface: SimpleTaskStatus
Used by the task to set a message associated to the current action of the task

Specified by:
message in interface SimpleTaskStatus

getTitle

public String getTitle()
Description copied from interface: TaskStatus
Get the title associated to the task of this TaskStatus

Specified by:
getTitle in interface TaskStatus
Returns:
the task title

getCode

public String getCode()
Description copied from interface: TaskStatus
Gte the code of this TaskStatus.

Specified by:
getCode in interface TaskStatus
Returns:
code of task

setCurValue

public void setCurValue(long value)
Description copied from interface: SimpleTaskStatus
Used by the task to set the current step of the task.

Specified by:
setCurValue in interface SimpleTaskStatus
See Also:
setRangeOfValues

getCompleted

public int getCompleted()
Description copied from interface: TaskStatus
Retorna el porcentaje de completitud de la tarea asociada a este TaskStatus.

Specified by:
getCompleted in interface TaskStatus
Returns:
el porcentaje de completitud.

getLabel

public String getLabel()
Description copied from interface: TaskStatus
Get a label that represent the status of the task

Specified by:
getLabel in interface TaskStatus
Returns:

terminate

public void terminate()
Description copied from interface: SimpleTaskStatus
Used by the task to inform that it has terminated without errors.

Specified by:
terminate in interface SimpleTaskStatus

cancel

public void cancel()
Description copied from interface: SimpleTaskStatus
Used by the task to inform that it has terminated cancelled by the user or another task.

Specified by:
cancel in interface SimpleTaskStatus

abort

public void abort()
Description copied from interface: SimpleTaskStatus
Used by the task to inform that it has terminated with errors.

Specified by:
abort in interface SimpleTaskStatus

isCancelled

public boolean isCancelled()
Description copied from interface: TaskStatus
Return true if the task has cancelled by the user or another task.

Specified by:
isCancelled in interface TaskStatus
Returns:

isAborted

public boolean isAborted()
Description copied from interface: TaskStatus
Return true if the task has terminated with errors.

Specified by:
isAborted in interface TaskStatus
Returns:

isRunning

public boolean isRunning()
Description copied from interface: TaskStatus
Return true if the task is running.

Specified by:
isRunning in interface TaskStatus
Returns:

getManager

public TaskStatusManager getManager()
Description copied from interface: TaskStatus
Return the TaskStatusManager associated to this TaskStatus.

Specified by:
getManager in interface TaskStatus
Returns:
the TaskStatusManager

isIndeterminate

public boolean isIndeterminate()
Description copied from interface: TaskStatus
Return true if the completion of this task can't calculate.

Specified by:
isIndeterminate in interface TaskStatus
Returns:

add

public void add()
Description copied from interface: SimpleTaskStatus
Add this TaskStatus to the TaskStatusManager. If TaskStatus already in the manager this is updated.

Specified by:
add in interface SimpleTaskStatus

remove

public void remove()
Description copied from interface: SimpleTaskStatus
Remove this TaskStatus from the TaskStatusManager

Specified by:
remove in interface SimpleTaskStatus

isCancellable

public boolean isCancellable()
Description copied from interface: TaskStatus
Return true if the task associated to this TaskStatus can be canceled.

Specified by:
isCancellable in interface TaskStatus
Returns:

setCancellable

public void setCancellable(boolean cancellable)
Description copied from interface: SimpleTaskStatus
Used by the task to inform that this task es cacellable.

Specified by:
setCancellable in interface SimpleTaskStatus

isCancellationRequested

public boolean isCancellationRequested()
Description copied from interface: CancellableTask
Return true if has request to cancel to the task.

Specified by:
isCancellationRequested in interface CancellableTask

cancelRequest

public void cancelRequest()
Description copied from interface: CancellableTask
Request to the task that cancel.

Specified by:
cancelRequest in interface CancellableTask

addObserver

public void addObserver(Observer o)
Specified by:
addObserver in interface Observable

deleteObserver

public void deleteObserver(Observer o)
Specified by:
deleteObserver in interface Observable

deleteObservers

public void deleteObservers()
Specified by:
deleteObservers in interface Observable

setTittle

public void setTittle(String tittle)
Description copied from interface: SimpleTaskStatus
Used by the task to set the title associated to the task. It can't be changed.

Specified by:
setTittle in interface SimpleTaskStatus

setTitle

public void setTitle(String title)
Description copied from interface: SimpleTaskStatus
Used by the task to set the title associated to the task. It can't be changed.

Specified by:
setTitle in interface SimpleTaskStatus

setAutoremove

public void setAutoremove(boolean autoremove)
Description copied from interface: SimpleTaskStatus
Used by the task to inform that this TaskStatus is removed from the manager automatically when the task is terminated and the manager need.

Specified by:
setAutoremove in interface SimpleTaskStatus

getAutoRemove

public boolean getAutoRemove()
Description copied from interface: SimpleTaskStatus
Return the autoremove value of this TaskStatus.

Specified by:
getAutoRemove in interface SimpleTaskStatus
Returns:


Copyright © 2004-2011 gvSIG. All Rights Reserved.