Package com.pnfsoftware.jeb.util.base
Class ProgressCallbackAdapter
java.lang.Object
com.pnfsoftware.jeb.util.base.ProgressCallbackAdapter
- All Implemented Interfaces:
IProgressCallback
A concurrency-friendly, standard implementation of the progress callback interface. Sub-classes
may override the methods they want.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal long
final long
getTotal()
long
void
This method is used by the provider to send a transient message to its client.void
setCurrent
(long current) This method is called by a provider to update the current computation count.void
setTotal
(long total) This method called by a provider (generally once) to set an initial (possibly estimate) computation count.void
updateTotal
(long count) Set or update the total by the provided unit amount.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pnfsoftware.jeb.util.base.IProgressCallback
isInitialized, message
-
Constructor Details
-
ProgressCallbackAdapter
public ProgressCallbackAdapter()
-
-
Method Details
-
setTotal
public void setTotal(long total) Description copied from interface:IProgressCallback
This method called by a provider (generally once) to set an initial (possibly estimate) computation count. The number in itself is arbitrary.- Specified by:
setTotal
in interfaceIProgressCallback
-
getTotal
public final long getTotal()- Specified by:
getTotal
in interfaceIProgressCallback
- Returns:
-
updateTotal
public void updateTotal(long count) Description copied from interface:IProgressCallback
Set or update the total by the provided unit amount. If the totalhad been set
, it is updated; else, it is set.- Specified by:
updateTotal
in interfaceIProgressCallback
-
setCurrent
public void setCurrent(long current) Description copied from interface:IProgressCallback
This method is called by a provider to update the current computation count. Together with the total count, a client may compute an estimated completion ratio.- Specified by:
setCurrent
in interfaceIProgressCallback
-
getCurrent
public final long getCurrent()- Specified by:
getCurrent
in interfaceIProgressCallback
- Returns:
-
increment
public long increment()- Specified by:
increment
in interfaceIProgressCallback
- Returns:
- the incremented value
-
message
Description copied from interface:IProgressCallback
This method is used by the provider to send a transient message to its client.- Specified by:
message
in interfaceIProgressCallback
- Parameters:
id
- message id (0 or 1)msg
- message string
-