public class TaskProgress extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TaskProgress.State
Progress state
|
Modifier and Type | Field and Description |
---|---|
private Exception |
_exception |
private float |
_progress |
private TaskProgress.State |
_state |
private float |
_total |
Constructor and Description |
---|
TaskProgress(float total)
Ctor
|
TaskProgress(float total,
float start)
Overriden Ctor
|
Modifier and Type | Method and Description |
---|---|
Exception |
getException()
getException
|
Map<String,Object> |
getProgressInfo()
Returns information this progress object.
|
float |
getProgressPercentage()
getProgressPercentage
|
TaskProgress.State |
getState()
getState
|
boolean |
isFinished()
isFinished
|
boolean |
isInErrorState()
isInErrorState
|
boolean |
isNotStarted()
isNotStarted
|
boolean |
isRunning()
isRunning
|
void |
progress()
Unit progress
|
void |
progress(float quantity)
Quantitative progress
|
void |
progressRelativePercentage(int percentage)
Progress by a percentage relative to the range [current progress; total]
|
void |
progressTotalPercentage(int percentage)
Progress by a given percentage
|
void |
setFinished()
setFinished
|
void |
setInErrorState()
setInErrorState
|
void |
setInErrorState(Exception e)
setInErrorState
|
void |
setRunning()
setRunning
|
String |
toString() |
private final float _total
private float _progress
private TaskProgress.State _state
private Exception _exception
public TaskProgress(float total)
total
- The total progresspublic TaskProgress(float total, float start)
total
- The total progressstart
- The progress startpublic void progress()
public void progress(float quantity)
quantity
- The quantity to progresspublic void progressRelativePercentage(int percentage)
percentage
- must be in the [0; 100] rangepublic void progressTotalPercentage(int percentage)
percentage
- must be in the [0; 100] rangepublic float getProgressPercentage()
public void setRunning()
public void setFinished()
public void setInErrorState()
public void setInErrorState(Exception e)
e
- The exception responsible for the error statepublic boolean isNotStarted()
public boolean isRunning()
public boolean isFinished()
public boolean isInErrorState()
public Exception getException()
public TaskProgress.State getState()
public Map<String,Object> getProgressInfo()