Package org.pepsoft.util
Class TextProgressReceiver
java.lang.Object
org.pepsoft.util.TextProgressReceiver
- All Implemented Interfaces:
ProgressReceiver
A simple text-based progress received which prints a bar of fifty dots.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pepsoft.util.ProgressReceiver
ProgressReceiver.OperationCancelled, ProgressReceiver.OperationCancelledByUser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck whether the operation has been canceled.voiddone()Report that the operation has succeeded successfully.voidexceptionThrown(Throwable exception) Report that the operation has been aborted due to an exception having been thrown.voidreset()Restart the progress bar.voidsetMessage(String message) Change the message describing the current operation.voidsetProgress(float progressFraction) Set the progress as a value from 0.0f to 1.0f (inclusive).voidsubProgressStarted(SubProgressReceiver subProgressReceiver) Invoked when a subordinateSubProgressReceiveris started, reporting to this progress receiver.
-
Constructor Details
-
TextProgressReceiver
public TextProgressReceiver()
-
-
Method Details
-
setProgress
public void setProgress(float progressFraction) Description copied from interface:ProgressReceiverSet the progress as a value from 0.0f to 1.0f (inclusive).- Specified by:
setProgressin interfaceProgressReceiver- Parameters:
progressFraction- The progress to report.
-
exceptionThrown
Description copied from interface:ProgressReceiverReport that the operation has been aborted due to an exception having been thrown. Any other threads working on the same operation will be canceled.- Specified by:
exceptionThrownin interfaceProgressReceiver- Parameters:
exception- The exception which has been thrown.
-
reset
public void reset()Description copied from interface:ProgressReceiverRestart the progress bar. All progress will be wiped out and the next expected progress report will be expected to be as if progress started from 0.0f again.- Specified by:
resetin interfaceProgressReceiver
-
done
public void done()Description copied from interface:ProgressReceiverReport that the operation has succeeded successfully.- Specified by:
donein interfaceProgressReceiver
-
setMessage
Description copied from interface:ProgressReceiverChange the message describing the current operation.- Specified by:
setMessagein interfaceProgressReceiver- Parameters:
message- A message describing the current operation.
-
checkForCancellation
public void checkForCancellation()Description copied from interface:ProgressReceiverCheck whether the operation has been canceled. AnOperationCancelledexception will be thrown if it has.- Specified by:
checkForCancellationin interfaceProgressReceiver
-
subProgressStarted
Description copied from interface:ProgressReceiverInvoked when a subordinateSubProgressReceiveris started, reporting to this progress receiver.- Specified by:
subProgressStartedin interfaceProgressReceiver- Parameters:
subProgressReceiver- The sub progress receiver which has been started.
-