public interface Progress
The GNU Lesser General Public License for details.
Modifier and Type | Field and Description |
---|---|
static String |
CREATE_INDEX |
static String |
DOWNLOAD_SEARCH_INDEX |
static String |
INSTALL_BOOK |
static String |
RELOAD_BOOK_LIST |
static int |
UNKNOWN
Indicate that the total amount of work is unknown.
|
Modifier and Type | Method and Description |
---|---|
void |
beginJob(String sectionName)
Start the task measured from 0 to 100.
|
void |
beginJob(String sectionName,
int totalWork)
Start the task reporting progress toward total work.
|
void |
beginJob(String sectionName,
URI predictURI)
Start the task using timings from a prior run as a guess for the current
run.
|
void |
cancel()
Cancel the job (if possible).
|
void |
done()
Called to indicate that we are finished doing work.
|
String |
getJobID() |
String |
getJobName() |
ProgressMode |
getProgressMode()
Gets the current ProgressMode.
|
String |
getSectionName()
The section name is used in reporting progress.
|
int |
getTotalWork() |
int |
getWork()
Return the computed percentage as an integer, typically from 0 to 100.
|
int |
getWorkDone() |
void |
incrementWorkDone(int step)
Indicate progress toward the whole.
|
boolean |
isCancelable()
Might the job be cancelable?
|
boolean |
isFinished()
Used to determine whether job is done or canceled or reached totalWork.
|
void |
setCancelable(boolean newCancelable)
Indicates whether the job is cancelable or not.
|
void |
setSectionName(String name)
We have moved onto another section so update the section title.
|
void |
setTotalWork(int totalWork)
Set the total amount of work to be done.
|
void |
setWork(int progress)
Indicate progress toward 100%.
|
void |
setWorkDone(int progress)
Indicate progress toward the whole.
|
static final int UNKNOWN
static final String INSTALL_BOOK
static final String RELOAD_BOOK_LIST
static final String DOWNLOAD_SEARCH_INDEX
static final String CREATE_INDEX
void beginJob(String sectionName)
sectionName
- the initial name of the job.void beginJob(String sectionName, int totalWork)
sectionName
- the initial name of the job.totalWork
- the total amount that is to be worked.void beginJob(String sectionName, URI predictURI)
sectionName
- the initial name of the job.predictURI
- the URI of a properties file from which past behavior is read
and the results of the current run are stored.String getJobName()
String getJobID()
ProgressMode getProgressMode()
int getTotalWork()
void setTotalWork(int totalWork)
totalWork
- the total amount of work to be done in units that make sense
to the caller.int getWork()
void setWork(int progress)
progress
- a part of the whole.int getWorkDone()
void setWorkDone(int progress)
progress
- a part of the whole.void incrementWorkDone(int step)
step
- the amount of work done since the last call.String getSectionName()
void setSectionName(String name)
name
- the name of the sectionvoid done()
void cancel()
boolean isFinished()
boolean isCancelable()
void setCancelable(boolean newCancelable)
newCancelable
- The state to set.