Package org.xblackcat.sjpu.cli.progress
Class PercentProgressPublisher
java.lang.Object
org.xblackcat.sjpu.cli.progress.AProgressPublisher
org.xblackcat.sjpu.cli.progress.PercentProgressPublisher
- All Implemented Interfaces:
IProgressPublisher
-
Field Summary
Fields inherited from class org.xblackcat.sjpu.cli.progress.AProgressPublisher
outputFields inherited from interface org.xblackcat.sjpu.cli.progress.IProgressPublisher
NO_RENDERER -
Constructor Summary
ConstructorsConstructorDescriptionPercentProgressPublisher(Consumer<String> output, long total) PercentProgressPublisher(Consumer<String> output, long total, String formatString) Build Percent progress builder with custom progress string -
Method Summary
Modifier and TypeMethodDescriptionbooleanpublish(long current) Publish and render a new value for progressMethods inherited from class org.xblackcat.sjpu.cli.progress.AProgressPublisher
done, isDone
-
Constructor Details
-
PercentProgressPublisher
-
PercentProgressPublisher
Build Percent progress builder with custom progress string- Parameters:
output-total-formatString- formatted progress string. Can accept two arguments: 1. double(percentage value) and 2. long (total elements amount). SeeFORMATfpr details
-
-
Method Details
-
publish
public boolean publish(long current) Description copied from interface:IProgressPublisherPublish and render a new value for progress- Parameters:
current- new progress value- Returns:
- true if progress string has changed
-