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 longRetrieve the current unit count.final longgetTotal()Retrieve the total unit count.longIncrement the current unit count.voidThis 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 is called by a provider (generally once) to set an initial (possibly estimated) 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 is called by a provider (generally once) to set an initial (possibly estimated) computation count. The number in itself is arbitrary.- Specified by:
setTotalin interfaceIProgressCallback- Parameters:
total- total unit count
-
getTotal
public final long getTotal()Description copied from interface:IProgressCallbackRetrieve the total unit count.- Specified by:
getTotalin interfaceIProgressCallback- Returns:
- total unit count
-
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- Parameters:
count- unit count to add or set
-
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- Parameters:
current- current unit count
-
getCurrent
public final long getCurrent()Description copied from interface:IProgressCallbackRetrieve the current unit count.- Specified by:
getCurrentin interfaceIProgressCallback- Returns:
- current unit count
-
increment
public long increment()Description copied from interface:IProgressCallbackIncrement the current unit count.- 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
-