public class WorkProgressImpl extends Object implements WorkProgress
WorkProgress.MultiTask| Modifier and Type | Field and Description |
|---|---|
protected long |
amount |
protected AsyncEvent |
event |
protected long |
position |
protected String |
subText |
protected SynchronizationPoint<Exception> |
synch |
protected String |
text |
| Constructor and Description |
|---|
WorkProgressImpl(long amount)
Constructor.
|
WorkProgressImpl(long amount,
String text)
Constructor.
|
WorkProgressImpl(long amount,
String text,
String subText)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(CancelException reason)
Cancel the underlying work.
|
protected void |
changed() |
void |
done()
Signal all the work has been done.
|
void |
error(Exception error)
Signal an error.
|
long |
getAmount()
Return the total amount of work to be done.
|
long |
getPosition()
Return the current position, which is the current amount of work already done.
|
long |
getRemainingWork()
Return the amount of remaining work.
|
String |
getSubText()
Return a sub-text describing the work being done.
|
ISynchronizationPoint<Exception> |
getSynch()
Return a synchronization point that will be unblocked by one of the method done, error or cancel.
|
String |
getText()
Return the text describing the work being done.
|
void |
listen(Runnable onchange)
Add a listener to call on every change in the progress.
|
void |
progress(long amountDone)
Add an amount of work already done.
|
void |
setAmount(long work)
Set the total amount of work to be done.
|
void |
setPosition(long position)
Set the position (amount of work already done).
|
void |
setSubText(String text)
Set the sub-text describing the work being done.
|
void |
setText(String text)
Set the text describing the work being done.
|
void |
unlisten(Runnable onchange)
Remove a listener to call on every change in the progress.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlink, linkTo, linkToprotected long amount
protected long position
protected String text
protected String subText
protected SynchronizationPoint<Exception> synch
protected AsyncEvent event
public WorkProgressImpl(long amount,
String text)
public WorkProgressImpl(long amount)
public void setAmount(long work)
WorkProgresssetAmount in interface WorkProgresspublic long getAmount()
WorkProgressgetAmount in interface WorkProgresspublic void setPosition(long position)
WorkProgresssetPosition in interface WorkProgresspublic long getPosition()
WorkProgressgetPosition in interface WorkProgresspublic void progress(long amountDone)
WorkProgressprogress in interface WorkProgresspublic void done()
WorkProgressdone in interface WorkProgresspublic void error(Exception error)
WorkProgresserror in interface WorkProgresspublic void cancel(CancelException reason)
WorkProgresscancel in interface WorkProgresspublic ISynchronizationPoint<Exception> getSynch()
WorkProgressgetSynch in interface WorkProgresspublic long getRemainingWork()
WorkProgressgetRemainingWork in interface WorkProgresspublic String getText()
WorkProgressgetText in interface WorkProgresspublic void setText(String text)
WorkProgresssetText in interface WorkProgresspublic String getSubText()
WorkProgressgetSubText in interface WorkProgresspublic void setSubText(String text)
WorkProgresssetSubText in interface WorkProgresspublic void listen(Runnable onchange)
WorkProgresslisten in interface WorkProgresspublic void unlisten(Runnable onchange)
WorkProgressunlisten in interface WorkProgressprotected void changed()
Copyright © 2017. All rights reserved.