Package com.pnfsoftware.jeb.util.base
Interface IProgressCallback
- All Known Implementing Classes:
ProgressCallbackAdapter
public interface IProgressCallback
Progress callback interface, used by various types to provide progress information about an
on-going task. Methods involving lengthy operations (referred to as 'provider') sometimes accept
such objects and use them to provide progress information to the caller (referred to as
'client').
-
Method Summary
Modifier and TypeMethodDescriptionlongRetrieve the current unit count.longgetTotal()Retrieve the total unit count.longIncrement the current unit count.default booleanDetermine whether this object is initialized.voidThis method is used by the provider to send a transient message to its client.default voidThis method is used by the provider to send a transient message to its client, with id 0.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.
-
Method Details
-
isInitialized
default boolean isInitialized()Determine whether this object is initialized.- Returns:
- true if a positive total was set
-
setTotal
void setTotal(long total) This method is called by a provider (generally once) to set an initial (possibly estimated) computation count. The number in itself is arbitrary.- Parameters:
total- total unit count
-
getTotal
long getTotal()Retrieve the total unit count.- Returns:
- total unit count
-
updateTotal
void updateTotal(long count) Set or update the total by the provided unit amount. If the totalhad been set, it is updated; else, it is set.- Parameters:
count- unit count to add or set
-
setCurrent
void setCurrent(long current) 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.- Parameters:
current- current unit count
-
getCurrent
long getCurrent()Retrieve the current unit count.- Returns:
- current unit count
-
increment
long increment()Increment the current unit count.- Returns:
- the incremented value
-
message
This method is used by the provider to send a transient message to its client, with id 0. It is the same asmessage(0, msg).- Parameters:
msg- message string
-
message
This method is used by the provider to send a transient message to its client.- Parameters:
id- message id (0 or 1)msg- message string
-