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 longfinal longgetTotal()longvoidThis method is used by the provider to send a transient message to its client.voidsetCurrent(long current) This method is called by a provider to update the current computation count.voidsetTotal(long total) This method called by a provider (generally once) to set an initial (possibly estimate) computation count.voidupdateTotal(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, waitMethods 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:IProgressCallbackThis method called by a provider (generally once) to set an initial (possibly estimate) computation count. The number in itself is arbitrary.- Specified by:
setTotalin interfaceIProgressCallback
-
getTotal
public final long getTotal()- Specified by:
getTotalin interfaceIProgressCallback- Returns:
-
updateTotal
public void updateTotal(long count) Description copied from interface:IProgressCallbackSet or update the total by the provided unit amount. If the totalhad been set, it is updated; else, it is set.- Specified by:
updateTotalin interfaceIProgressCallback
-
setCurrent
public void setCurrent(long current) Description copied from interface:IProgressCallbackThis 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:
setCurrentin interfaceIProgressCallback
-
getCurrent
public final long getCurrent()- Specified by:
getCurrentin interfaceIProgressCallback- Returns:
-
increment
public long increment()- Specified by:
incrementin interfaceIProgressCallback- Returns:
- the incremented value
-
message
Description copied from interface:IProgressCallbackThis method is used by the provider to send a transient message to its client.- Specified by:
messagein interfaceIProgressCallback- Parameters:
id- message id (0 or 1)msg- message string
-